CLI: report incomplete shader directory scans #517
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!517
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Dathinel on GitHub · 2026-11-24 04:23 UTC · original
Dathinel:fix/report-shader-traversal-errors→main· +93 −10 · 3 files · 5 commits · openBoth
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.
940d32f69b' into vic25/ci c3b5c4b7e8@geiyiliyabumo on GitHub · 2026-11-24 13:38 UTC · original
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.
@Dathinel on GitHub · 2026-11-24 19:25 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 00:23 UTC · original · edited 2026-11-25 07:25 UTC
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
@Dathinel on GitHub · 2026-11-25 00:43 UTC · original
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.
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.