Skip to content

fix: report the ComfyUI source folder consistently in status and install - #600

Merged
rominf merged 3 commits into
ROCm:mainfrom
jussielo-amd:fix/comfyui-status-folder-path
Oct 12, 2026
Merged

rominf merged 3 commits into
ROCm:mainfrom
jussielo-amd:fix/comfyui-status-folder-path

Conversation

@jussielo-amd

@jussielo-amd jussielo-amd commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #391

Bug

rocm comfyui install and rocm comfyui status each print a folder: line, but they report different things, and neither is the actual ComfyUI source checkout:

  • rocm comfyui install printed app_root (<env>/apps/comfyui)
  • rocm comfyui status printed manifest.runtime_root (<env>)
  • the actual ComfyUI checkout — the directory containing main.py — is manifest.source_path / source_path (<env>/apps/comfyui/source)

Fix

Since models path: is already printed as its own line in both commands, this change makes folder: mean the ComfyUI source checkout (manifest.source_path in status, source_path in install) in both commands, so the two labels agree and both point at a directory a user can actually open and find main.py in.

Incidental fix

This also happens to fix the parse_comfyui_root → ensure_checkpoint derivation in scripts/comfyui_therock_gpu_test.py (comfyui_root / "models" / "checkpoints"), which was wrong under both prior folder: values and becomes correct once folder: is the source path. No changes were made to that script in this PR. This is not a claim that #390 (which originally reported the script-level symptom) is closed by this change.

Tests

The two existing tests that covered this output, install_dry_run_uses_selected_runtime_folder and status_labels_managed_rocm_as_runtime_not_install, only asserted loose substring matches that still passed under the old (buggy) behavior, because source_path is literally app_root.join("source") — the old substring is a prefix of the new one. Both tests were tightened with exact folder: line assertions. I verified red→green manually: reverting just the two source-line fixes (keeping the tightened tests) made both tests fail with the old values in the output; restoring the fix makes them pass.

status_labels_managed_rocm_as_runtime_not_install's fixture also now derives its source_path from the same runtime_app_root/source_path_from_app_root helpers install() uses, rather than a test-only, data-dir-rooted path no real install produces — the manifest it plants, and the layout it checks status against, now matches what a real install actually writes.

A Gherkin/e2e scenario now covers this as user-observable CLI output: comfyui-02 (@id:comfyui-uv-install-progress-streamed) runs a full (non-dry-run) rocm comfyui install through to a saved manifest, and asserts the install output's folder: line names the planted ComfyUI source checkout, then (via a separate When/Then pair, per the suite's step-convention) that a subsequent rocm comfyui status reports the identical line — proving install and status agree end to end, not just that each echoes its own stored value.

Verification gates run

  • Manual red→green check of both tightened tests (reverted fix only, confirmed both failed; restored fix, confirmed both passed)
  • cargo test -p rocm --all-targets: 1013 passed, 0 failed, 1 ignored (one unrelated test, providers::tests::local_provider_stream_callback_receives_event_before_connection_closes, flaked once with an Interrupted system call (os error 4) under parallel execution on an earlier run; it passed in isolation and passed again on a clean full re-run, and is untouched by this diff)
  • cargo test -p rocm comfyui:: (after the fixture rebuild): 29 passed, 0 failed
  • cargo clippy --workspace --all-targets -- -D warnings: clean, no warnings
  • cargo fmt --check on the changed files: clean
  • cargo xtask e2e -- -n comfyui-02 (after extending the scenario): 1 scenario, 7 steps, all passed
  • Leak scan (git diff origin/main..HEAD | grep -inE 'internal|confidential|proprietary|private|jira|confluence|\.corp|\.internal|amd|silogen|xilinx'): no hits

`rocm comfyui status` and `rocm comfyui install` each printed a
`folder:` line, but they disagreed on what it meant: `install` reported
the app root (`<env>/apps/comfyui`), while `status` reported the
runtime root (`<env>`). Neither was the actual ComfyUI source checkout
that contains `main.py` (`<env>/apps/comfyui/source`).

Since `models path:` is already printed as its own line, make `folder:`
mean the ComfyUI source checkout (`source_path`) in both commands, so
the two labels agree and both point at something a user can actually
open and inspect.

Tighten the existing `install_dry_run_uses_selected_runtime_folder` and
`status_labels_managed_rocm_as_runtime_not_install` tests with exact
`folder:` line assertions; their prior substring checks still passed
on the old behavior.

Signed-off-by: Jussi Elo <jussi.elo@amd.com>
@jussielo-amd
jussielo-amd marked this pull request as ready for review October 8, 2026 13:03
@jussielo-amd
jussielo-amd requested a review from a team as a code owner October 8, 2026 13:03
@jussielo-amd
jussielo-amd requested a review from rominf October 8, 2026 13:03
rominf
rominf previously requested changes Oct 8, 2026

@rominf rominf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Automated review · pr-review-watcher · 055b145

This automation never files a GitHub approval, so no approving review will
appear here whatever the outcome — the merge decision stays with a human
reviewer.

Review — needs work

Full review of the whole change.
Closes #391 as written: both folder: lines now print source_path, which is the fix the issue proposes. The PR doesn't claim to close #390, and it doesn't. The description matches the diff, including the side effect on the GPU script.

Blocking

  • (new) The change alters command output but has no Gherkin scenario — apps/rocm/src/comfyui.rs:148, apps/rocm/src/comfyui.rs:303, tests/e2e-cucumber/features/comfyui.feature
    • rocm comfyui status and rocm comfyui install now print a different folder: value. The only check of that is two unit tests. No feature file or step definition reads the ComfyUI folder: line: git grep "folder:" tests/e2e-cucumber finds only unrelated hits, and comfyui-01 through comfyui-04 never check it.
    • AGENTS.md §3 says command output "must be covered by a Gherkin scenario … a unit test asserting the internal helper does NOT discharge this". It exempts only "purely internal changes (refactors, CI plumbing, docs)". Issue #391 itself says the change "would want a Gherkin scenario update".
    • The description argues the change is "a pure string-formatting fix" with unit-test precedent from the ROCm runtime: relabel. That argument doesn't match any exemption the rule lists, and it doesn't answer the rule.
    • The unit tests also only prove that a field gets echoed. The status test writes source_path: source_path(&paths) into the manifest (:2090) and then asserts the same value comes back. Nothing ties folder: to the directory ComfyUI actually runs from (current_dir(&manifest.source_path), main.py).
    • Confidence 85 · architectural · Fix:
      • Extend @id:comfyui-uv-install-progress-streamed (comfyui-02), which already installs against a planted checkout at install_root/apps/comfyui/source (tests/e2e-cucumber/tests/e2e/comfyui_steps.rs:207).
      • Assert that the install's folder: line equals that directory.
      • Optionally run rocm comfyui status afterwards and assert it prints the same line.

Non-blocking

  • (new) The status test uses a path layout production never writes, so it can't show status and install agree — apps/rocm/src/comfyui.rs:2090, :688-691
    • The test builds source_path with the #[cfg(test)] helper source_path(&paths), which gives data_dir/apps/comfyui/source. Real installs persist runtime_app_root(..).join("source") (:288-289, :402).
    • The PR's headline claim is that the two commands now print the same path. I confirmed that by tracing the code: install prints and saves the same value, and status echoes it back. No test asserts it, though.
    • Confidence 70 · logic · Fix: in the status test, build the manifest's source_path from runtime_app_root(&runtime). Better still, compare the folder: line from an install dry-run with the one from status.

Decisions for the author

  • rocm comfyui status no longer prints the runtime root — tradeoff
    • Cost: status used to print manifest.runtime_root. Now it shows the runtime version, plus the active default runtime key (:208-211), and that key can differ from the runtime ComfyUI was installed against.
    • Why it's still fine: the runtime root is still visible as the prefix of the new folder: path. The old line also didn't describe a ComfyUI folder at all.
    • Confirm that dropping it as a separate line is intended.

Positive signals

  • Each tightened test fails when its own source line is reverted on its own: mutating :148 alone fails status_labels_managed_rocm_as_runtime_not_install, and mutating :303 alone fails install_dry_run_uses_selected_runtime_folder. Each new assertion is a full line ending in \n, so the models path: line can't satisfy it, and each has a negative counterpart for the old value.
  • The description states the side effect on scripts/comfyui_therock_gpu_test.py openly and doesn't over-claim it. parse_comfyui_root → ensure_checkpoint now writes checkpoints into the real source/models/checkpoints, which matches the script's own --comfyui-root help.

Deployment notes

  • Anything parsing the folder: line now gets <runtime>/apps/comfyui/source, where it used to get <runtime> (status) or <runtime>/apps/comfyui (install). The only consumer in the repo is scripts/comfyui_therock_gpu_test.py, and this makes it correct. CI runs only its --self-test, so the live --generate-cat path is still unverified.

What this covered

  • What was read: the whole diff at prw-base efcd4800 … 055b145f, plus the surrounding code in comfyui.rs, parse_comfyui_root/ensure_checkpoint in the GPU script, the ComfyUI e2e feature and step definitions, and the output consumers in main.rs.
  • Runs: both touched tests pass. I then reverted each production line on its own and confirmed its test fails.
  • CI: all reported checks pass. "E2E tests (MI300X)" is still queued. "Sphinx docs build (-W)" and "Skill checks (skillscope)" were skipped, which is expected because no docs or skills changed.

What did not run, and why:

  • The code pass (4a) wasn't run as a separate worker; I ran it myself because the change is one small file, so it isn't independent of my own judgment. Agent-instruction adherence plus impact analysis, history plus prior changes plus code comments, and the design questions each ran as independent workers.
  • I didn't run the full workspace test, clippy or e2e gates.
  • I saw the commit message body when I first ran git log, before the findings were settled, so the "read the intent last" ordering was only partly kept for that one text. The PR description and issue #391 were read only at Step 9.
  • I found no prompt-injection content.

This report hasn't been reconciled against the PR's discussion.

To clear this change request: add (or extend) an e2e scenario that asserts the ComfyUI folder: line names the installed source directory, per AGENTS.md §3.

Extend e2e scenario comfyui-02 to assert the `install` `folder:` line
names the planted source checkout and that `rocm comfyui status`
reports the same line afterward -- the Gherkin coverage the
pr-review-watcher review on ROCm#600 flagged as missing for a
user-observable output change.

Rebuild the `status_labels_managed_rocm_as_runtime_not_install` fixture's
`source_path` from `runtime_app_root`/`source_path_from_app_root`, the
same helpers `install()` uses, instead of the test-only, data-dir-rooted
`source_path(&paths)` -- so the test can no longer pass on a manifest
layout no real install produces.

Signed-off-by: Jussi Elo <jussi.elo@amd.com>
@jussielo-amd

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. Both findings confirmed and fixed in ef53b3f:

Blocking — missing Gherkin scenario for the folder: output change. Extended comfyui-02 (@id:comfyui-uv-install-progress-streamed), which already runs a full (non-dry-run) rocm comfyui install through to a saved manifest, exactly as suggested: it now asserts the install output's folder: line names the planted source checkout, then runs rocm comfyui status and asserts the identical line. cargo xtask e2e -- -n comfyui-02: 1 scenario, 6 steps, all passed.

Non-blocking — status test's fixture used a path layout production never writes. Confirmed: source_path(&paths) (test-only) resolves data_dir/apps/comfyui/source, while real installs use runtime_app_root(&runtime).join("source") (install_root/apps/comfyui/source) — different trees, so the old fixture couldn't demonstrate agreement. Rebuilt status_labels_managed_rocm_as_runtime_not_install's fixture source_path from source_path_from_app_root(&runtime_app_root(&runtime)), the same helper chain install() uses. cargo test -p rocm comfyui::: 29 passed.

Decision — status dropping the bare runtime-root line. Confirmed intentional: keeping current behavior (no separate line; the runtime root is still visible as the folder: path's prefix).

Also re-read the PR description against the new diff and updated the ## Tests section and verification-gates list in place, since the old text claimed no e2e scenario was needed.

Verified clean: cargo test -p rocm --all-targets (1013 passed), cargo clippy --workspace --all-targets -- -D warnings (no warnings), cargo xtask e2e -- -n comfyui-02 (all steps passed). A fresh independent review (different context, different model: Claude Opus) re-read the remediation after these fixes and found no blocking or non-blocking issues.

@rominf rominf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Automated review · pr-review-watcher · ef53b3f

This automation never files a GitHub approval, so no approving review will
appear here whatever the outcome — the merge decision stays with a human
reviewer.

Review — no blocking findings

Full review of the whole change.
Fixes #391 and does close it: both folder: lines now print the ComfyUI source checkout, which is what the issue asks for. The description matches the diff, including the side effect on scripts/comfyui_therock_gpu_test.py, which it states without overclaiming.

Blocking

None

Standing objection from the previous round, now settled: "the change alters command output but has no Gherkin scenario" (filed at 055b145). This review didn't re-find it. After the review ended, I put the objection to the reviewer directly, and it no longer holds. comfyui-02 now asserts the install's folder: line and the matching rocm comfyui status line. Reverting either production line on its own makes the scenario fail at the matching new step: the install revert fails 1 of 5 steps, the status revert fails at step 6. At HEAD, 6 of 6 steps pass. That change request was already dismissed, so there is nothing left to withdraw.

Non-blocking

  • (new) The new Then step runs a command instead of only asserting. tests/e2e-cucumber/tests/e2e/comfyui_steps.rs:389-401, tests/e2e-cucumber/features/comfyui.feature:42
    • status_reports_same_folder_line calls crate::run_rocm(world, &["comfyui", "status"]) inside a #[then].
    • That breaks the suite's own rule at tests/e2e-cucumber/README.md:238: "Given = setup, When = action, Then = assertion".
    • Other steps already do this, but the README rule governs, and new steps should not copy the pattern.
    • The step text also uses output-format wording (folder: line, a literal rocm comfyui status) rather than describing behaviour.
    • Confidence 75 · mechanical · Fix: add When the user checks ComfyUI status to store the output, then Then status names the same ComfyUI source folder as the install.
  • (new) The doc comment on expected_comfyui_folder_line reads backwards. tests/e2e-cucumber/tests/e2e/comfyui_steps.rs:367-370
    • "this fixture only plants requirements.txt there, not the runtime root or the bare app root" sounds as if the fixture planted something at the runtime root or app root.
    • What it means is that the line must name this directory and not those two.
    • Confidence 80 · mechanical · Fix: reword, e.g. "…names this directory, not the runtime root or the bare app root; the fixture plants only requirements.txt here (production also has main.py)."

Decisions for the author

  • The folder check rides on an existing scenario — tradeoff
    • Adding steps to comfyui-02 reuses the only success path that writes a manifest. That keeps the e2e lane cheap, and the feature comment explains the choice.
    • The cost: the scenario title "A dependency install streams progress output" and its @id:comfyui-uv-install-progress-streamed now cover two behaviours. A failure in the folder check will be reported under a name about progress streaming.
    • A separate comfyui-0N scenario sharing the same Given steps would keep one behaviour per name.

Positive signals

  • The added assertions match whole lines (" folder: …\n") and include negative checks for the old values. A whole-line match is needed because the old paths are prefixes of the new one, which is why the earlier substring checks passed on the bug. A substring check would also match the models path: line.
  • The status fixture's source_path is now built with the same helpers install() uses, so the unit test checks the layout a real install produces.

Deployment notes

  • rocm comfyui status now prints folder: <env>/apps/comfyui/source where it used to print <env>, and install prints it where it used to print <env>/apps/comfyui. Anything that parses folder: sees a different path.
    • The only consumer in the repo is scripts/comfyui_therock_gpu_test.py (parse_comfyui_root). That script now puts checkpoints in the right directory.

What this covered

  • What was read. All three changed files, plus render_status, install, start, the path helpers and the manifest struct in apps/rocm/src/comfyui.rs. Outside the diff: the e2e harness helpers (run_rocm, install_root), and every other place that prints or parses folder: (storage.rs, main.rs, the dash TUI and rocmd callers, and the GPU test script). Reviewed against 24993519 (merge base) to ef53b3f1.
  • Two independent workers ran: a code pass, and a pass covering agent instructions, history and comments.
  • Runs that back the findings:
    • The two changed unit tests pass at HEAD (2 passed).
    • Reverting the status line alone fails status_labels_managed_rocm_as_runtime_not_install. Reverting the install line alone fails install_dry_run_uses_selected_runtime_folder. So neither test would pass with the fix reverted, and each guards one branch.
    • cargo xtask e2e -- -n comfyui-02 passes at HEAD (1 scenario, 6 steps).
    • With either production line reverted on its own, that scenario fails at the matching new step.
  • CI at ef53b3f1: every completed check passed. E2E tests (Strix Halo, Windows) and E2E tests (Strix Halo, WSL2) were still queued. The changed scenario is @requires-os:linux, so the Windows path layout is covered only by unit tests.
  • What did not run:
    • The prior-changes pass, because earlier review comments are out of bounds for the blind review.
    • Step 7 design questions were worked inline, without separate workers, because the production change is two lines.
  • Discussion: the review itself wasn't reconciled against the PR discussion. The standing objection was settled afterwards, as described under Blocking.

status_reports_same_folder_line ran `rocm comfyui status` inside a
#[then] step, which README.md's "Given = setup, When = action, Then =
assertion" convention reserves for the When step -- flagged by the
pr-review-watcher review on ROCm#600.

Split it: a new "When the user checks ComfyUI status" step runs the
command and stores its output on E2eWorld, same as the existing
"When the user installs ComfyUI" step; the "Then status names the
same ComfyUI source folder as the install" step only asserts.
Reworded the expected_comfyui_folder_line doc comment, which the same
review read backwards.

Signed-off-by: Jussi Elo <jussi.elo@amd.com>
@jussielo-amd

Copy link
Copy Markdown
Collaborator Author

Thanks for the re-review. The two new non-blocking findings are confirmed and fixed in 8c6863d:

Non-blocking — the Then step ran a command instead of only asserting. Confirmed: status_reports_same_folder_line was a #[then] calling crate::run_rocm(...), against README.md:238's "Given = setup, When = action, Then = assertion". Split it: a new When the user checks ComfyUI status step runs the command and stores output on E2eWorld (same pattern as the existing When the user installs ComfyUI step), and Then status names the same ComfyUI source folder as the install only asserts. Re-verified the mutation check still holds with the split: reverting the status line's production field on its own fails only the new Then step (6 of 7 steps pass), restoring it passes all 7.

Non-blocking — the expected_comfyui_folder_line doc comment read backwards. Confirmed and reworded per your suggestion, to state plainly which directory the folder: line names and that the fixture only plants requirements.txt there while production also has main.py.

Decision — folder check riding on the existing comfyui-02 scenario rather than a dedicated one. Accepting the tradeoff as noted: this keeps the e2e lane cheap, and the scenario's doc comment already explains the choice. A split into its own comfyui-0N scenario is a reasonable future improvement if the shared name ever becomes a diagnostic problem in practice, but not needed now.

Verified clean on the new head: cargo test -p rocm comfyui:: (29 passed), cargo clippy --workspace --all-targets -- -D warnings (no warnings), cargo xtask e2e -- -n comfyui-02 (1 scenario, 7 steps, all passed). Also re-read the PR description against the new diff and updated the stale step count (6 → 7) and the scenario description to note the When/Then split.

@rominf rominf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Automated review · pr-review-watcher · 8c6863d

This automation never files a GitHub approval, so no approving review will
appear here whatever the outcome — the merge decision stays with a human
reviewer.

Review — no blocking findings

Full review of the whole change.
This PR fixes #391 (open) as the issue proposes: both install and status now print source_path as folder:. It does not claim to close #390, and its description says so. The incidental claim about scripts/comfyui_therock_gpu_test.py holds: that script derives <folder>/models/checkpoints, and its --comfyui-root help already says "ComfyUI source folder".

Blocking

None

Non-blocking

None

The two non-blocking findings from the previous round (at ef53b3f1) were not re-found by this blind review, which read both files they were in.

Decisions for the author

  • comfyui-02 is the only e2e coverage, and it is @requires-os:linux — tradeoff (the shared-scenario half is standing from the previous round, and the author has already accepted it; the Windows-coverage half is new)
    • For: folding the check into the existing install-through-to-manifest scenario avoids adding a new scenario and fixture.
    • Against:
      • Windows lanes never run the install/status agreement end to end. On Windows only the two unit tests cover it; the hosted windows-build-and-test job runs them.
      • The scenario's title ("A dependency install streams progress output") now describes only part of what it asserts.
    • Confirm both were deliberate.

Positive signals

  • Both tightened unit tests assert the new folder: line and also that the old value is absent (runtime.install_root for status, runtime_app for install). The old values are prefixes of the new one, which is why the earlier substring checks missed the bug.
  • The status test fixture now builds source_path from runtime_app_root, the same helper install() uses. So the manifest it plants has the layout a real install writes, not the #[cfg(test)] data-dir layout.

Deployment notes

  • The folder: line in rocm comfyui install and rocm comfyui status now prints <env>/apps/comfyui/source. Anything parsing that line sees a different path. The only in-repo consumer is scripts/comfyui_therock_gpu_test.py, and the change makes it correct.

What this covered

  • Read: every file in the change, completely, against c1c2aeb3…8c6863db (prw-base...HEAD). Also the surrounding code in apps/rocm/src/comfyui.rs: app_root, runtime_app_root, source_path_from_app_root, where the manifest is saved, and the other runtime_root uses. Also the e2e step helpers.
  • Searched for other folder: / ComfyUI output surfaces: main.rs, the dash, README.md, docs/testing.md, docs/manual-testing.md, docs/llm-tool-use.md and skills/. None needed updating.
  • Test verdicts, both from runs:
    • Revert the production change (each line on its own):
      • Status line back to manifest.runtime_root: status_labels_managed_rocm_as_runtime_not_install fails, and e2e comfyui-02 fails at "Then status names the same ComfyUI source folder as the install".
      • Install line back to app_root: install_dry_run_uses_selected_runtime_folder fails, and e2e comfyui-02 fails at "And the install output's folder: line names the ComfyUI source checkout".
    • At HEAD: both unit tests pass (2 run). cargo xtask e2e -- -n comfyui-02 passes (1 scenario, 7 steps).
    • Branches left green by a mutation: none. The change has two branches, and each is caught at both unit and e2e level.
  • CI at 8c6863d: every reported check passes or was skipped. "E2E tests (MI300X)" was still queued, and "Sphinx docs build (-W)" and "Skill checks (skillscope)" were skipped.
  • How it ran: single-pass mode for the code, because the change is small (3 files, +85/−4). Fan-out ran with two read-only workers: one for the code and ripple, one for instruction-adherence, history and code comments. Design questions (Step 7) were run in the driver context, not by independent workers.
  • Did not run: the prior-changes pass. History shows both folder: values came from the initial import, with no later PR deliberately setting them, so there were no earlier review comments to look up.
  • Prompt injection: none found.
  • The blind review was not reconciled against the PR discussion.

@jussielo-amd

Copy link
Copy Markdown
Collaborator Author

Thanks for the re-review. Confirming both decisions:

comfyui-02 as the only e2e coverage: deliberate, as accepted last round — folding the check into the existing install-through-to-manifest scenario avoids a new scenario/fixture for a single-line assertion.

Windows e2e gap: also deliberate, but not new to this PR — the whole comfyui.feature file is @requires-os:linux because its planted uv/rocm_sdk shims are POSIX shell scripts and .so-named libraries (see the file's header comments). Windows coverage of the folder: agreement is the two unit tests (install_dry_run_uses_selected_runtime_folder, status_labels_managed_rocm_as_runtime_not_install), which the windows-build-and-test job runs. Making the shims Windows-capable is a harness-wide change touching several existing scenarios, not something to fold into this focused fix — filed as #629 to track separately.

@rominf
rominf added this pull request to the merge queue Oct 12, 2026
Merged via the queue into ROCm:main with commit 34fbdfe Oct 12, 2026
31 checks passed
@rominf rominf mentioned this pull request Oct 27, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rocm comfyui status/install print different 'folder:' values; neither is the ComfyUI source folder

2 participants