CLI: report incomplete shader directory scans #517
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/517"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-24T04:23:54Z.
Both
shader-infoandtranslateexit 0 when a scan root is missing. This makes an incomplete batch look like a successful scan of an empty directory.Report each traversal error on stderr, keep scanning accessible inputs, and exit 1 after printing the partial summary. A readable empty directory still exits 0. Scripts that use the exit status can now detect partial results.
Reproduce with
cargo run -p victory -- shader-info missing-dirorcargo run -p victory -- translate missing-dir, using a path that does not exist. On Windows 11 with Rust 1.98.1, both returned 0 ond2a4baeand 1 with this patch.cargo test --locked -p victory --test shader_pathschecks that both commands count a synthetic container between two missing roots and report both paths. The workspace suite passed (265 passed, 4 ignored).#254 moves the traversal loop in
translate; combining the changes requires resolving that hunk. #115 coverscensus.Codex implemented and tested the change. Claude Code independently reviewed the final diff.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T10:00:34Z.
Review: APPROVED
Tested
5f21114on Windows 11, RTX 5070, MSVC: the workspace passes (196 outsidevictory-shader), includingtests/shader_paths.rs.Cargo.tomlandCargo.lockchanges only addtempfileas a dev-dependency ofapps/victory. It is already a workspace dependency used by other crates' tests, so the lockfile only gains the edge and no new package.scan_entriesis shared by both commands. #115 does the same forcensus, with a depth-0 hard error instead. The two are slightly inconsistent (fail fast versus finish then fail), which is worth aligning eventually, but not in this PR.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T12:48:53Z.
Review: COMMENTED
Triage: this and #534 attack the same problem (shader/translate scan input failures) with different designs. Comparison for whoever reviews:
scan_entrieshelper counting walk errors, hard failure at the end (anyhow::ensure!(walk_errors == 0)), missing root surfaces as a traversal error, integration test drives the realvictorybinary (tests/shader_paths.rs, exit code 1, stderr names both bad inputs), and Cargo.lock is updated.anyhow::ensure!; unit tests in shader.rs/translate.rs; Cargo.lock NOT updated → breaks--lockedbuilds (verified locally, see my review there).Semantic difference that matters: #517 fails the entire scan if any traversal error occurs anywhere in the tree (one unreadable file in a big dump kills the run); #534 only fails on a missing root and merely reports per-file errors. For a diagnostic CLI over multi-GB title dumps I'd mildly prefer #534's distinction, but #517's integration test and lockfile are stronger as submitted.
Not verifiable on macOS (app crate doesn't build here); both diffs read correctly statically.
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T13:38:29Z.
Independent review on Windows 11 x64 / MSVC (merged PR head
5f21114into current main; reviewed the full origin/main..HEAD diff, clean auto-merge on translate.rs).Verified:
Looks correct and well scoped. scan_entries now counts (and prints) every WalkDir error; both shader-info and translate emit a non-zero exit via anyhow::ensure! when any traversal error occurred, while still printing the partial results first (best-effort output + honest exit code). Suppressing the "(none found...)" hint on an incomplete scan avoids reporting a failed scan as empty. The new test is hermetic/synthetic - it clears VICTORY_PAIRS so no GPU/D3D12 is needed - and checks exit 1, both missing roots, the exact count (2), and that the valid file is still scanned.
Non-blocking observations:
No blocking issues - nice, focused fix.
AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-24T19:25:29Z.
Thanks @geiyiliyabumo. Added the clean-directory case in
bab15db. Bothshader-info .andtranslate .must exit 0 and count the one synthetic container in the directory. The mixed-input case still requires exit 1 and checks that both missing paths are reported.To reproduce, run
cargo test --locked -p victory --test shader_paths. On Windows/MSVC, forcing either command to return 1 on a clean scan failed the new assertion. With the patch integrated locally againstffe310e, the workspace suite passed (343 passed, 6 ignored), as did both Clippy configurations from CI.For the overlap discussion, #115 covers census. At
29046af, #534 also includes the lockfile change and tests empty directories. The test here exercises the CLI on a populated directory.AI-assisted. All fixtures for this test are synthetic.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:23:20Z.
Automated triage for the maintainers.
Needs work: needs the maintainer's decision. The new head
d8cd94adrops thetempfiledev-dependency: the test makes its own fresh directory, andCargo.toml/Cargo.lockare untouched. That point is resolved, and #534 has been closed, so there is no competing change any more.The code reads correctly.
scan_entriesinapps/victory/src/shader.rsreports and countswalkdirerrors.shader::runandtranslate::runprint their partial results and then fail throughanyhow::ensure!, and the "(none found…)" hint is suppressed on an incomplete scan.One point the earlier comment should have named:
apps/victory/tests/shader_paths.rsruns the crate's ownvictorybinary throughstd::process::Command(CARGO_BIN_EXE_victory). That is the usual pattern for a Rust integration test and the risk is low. Still, new code that starts a process needs a maintainer's sign-off under the triage rules, so I am leaving that decision to the maintainer and not asking you to change it. Unreadable files and failedmetadata()calls are still skipped silently; that is not a blocker.CI: passing.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T00:43:39Z.
Resolved the conflicts in
0749a8eby integratingmain@4118f33. The shader pack listing and translation progress from main are preserved.On Windows/MSVC,
cargo test --locked -p victory --test shader_pathsfailed on unmodified main with the added test (a partial scan exited 0) and passed after the fix. Both Clippy configurations passed. The PR CI run and the main CI run fail the same two shader tests:gathers_at_a_level_match_the_hardwareandpermutes_read_the_lane_named_and_zero_from_lanes_left_out.AI-assisted; the scan regression uses a synthetic fixture.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T20:30:07Z.
I checked
d8cd94awith the shader-cache warm-up change in #3789. Combined b3f4a47 keeps both exact PR heads and uses your scan_entries helper for shader-info, ordinary translate and translate --cache.Both of your scan cases pass on current main. The warm-up regression reports two absent roots, caches the accessible generated container's result, and returns 1. A clean repeat gets one cache hit and returns 0. All 20 CLI tests, both strict CLI Clippy configurations and the asset policy passed.
You or the maintainer can use the combined branch if the changes land together. Please retain the Git authors on cherry-pick or rebase.
AI-assisted with OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.