Repository navigation
CLI: report shader scan input failures - #534
Quat3rnion wants to merge 3 commits into
Conversation
b7d0ab9 to
e1680af
Compare
|
Independent verification & code review on Windows 11 Pro (build 26100, Rust
Findings
AI-assisted; synthetic tests only, no game files. |
catminou4
left a comment
There was a problem hiding this comment.
Blocking issue, verified locally: this adds tempfile as a dev-dependency of apps/victory but does not update Cargo.lock. Test-merged with current main (ffe310e) and ran cargo metadata --locked →
error: cannot update the lock file .../Cargo.lock because --locked was passed to prevent this
So any --locked build/test (clippy CI uses --locked) fails until the lockfile is regenerated (cargo update -p victory --offline or just cargo check once and commit the lock). #517 solves the same problem and does include the lockfile update — see my triage comment there.
Design note for the maintainer's pick between this and #517: this PR's semantics are "missing root = hard error, per-file walk/read errors = report and continue (exit 0)"; #517's are "any traversal error fails the whole scan (exit 1)". I find this PR's distinction more practical for scanning large title dumps, but the unit tests here don't exercise translate.rs's scan (only shader.rs) and the app crate doesn't build on macOS, so I couldn't run them — the tests look correct statically.
DenRakEiw
left a comment
There was a problem hiding this comment.
Tested merged cleanly onto main (ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):
cargo test -p victory: 5 passed, 0 failed (a_missing_scan_path_is_an_error,an_empty_scan_directory_succeeds,a_missing_translation_path_is_an_error,an_empty_translation_directory_succeeds,loader_lock_is_reentrant_and_exclusive)cargo xtask policy: okcargo clippy -p victory --all-targets: 2clippy::items_after_test_modulewarnings:apps/victory/src/shader.rs:244:mod testsis defined beforefn format_instruction(...)apps/victory/src/translate.rs:156:mod scan_testsis defined beforepub fn run(...)and the remaining functions
Moving both #[cfg(test)] modules to the bottom of their respective files will clear both clippy warnings for CI.
AI-assisted (Gemini 4 Neon).
shader-info and translate used filter_map(Result::ok) over WalkDir and silently skipped metadata and read failures, so a mistyped explicit path exited successfully with zero shaders and a mixed scan undercounted coverage. Reject a path that does not exist, report per-file errors, and add CLI-level tests for a missing path and an empty directory.
|
Fixed the blocking issue: committed the |
e1680af to
54b4402
Compare
|
@geiyiliyabumo Thanks for the Windows clippy run. Fixed the |
|
Re-verified new head
Looks clean and ready to merge! AI-assisted; synthetic tests only, no game files. |
|
The Three consequences, largest first:
The 30 s stop→death gap stays measured and real, but its meaning moves from "heartbeat timeout" to "the signature-update deadline for the current step". Kill-map update: |
|
Automated triage for the maintainers. Closing because another open pull request covers the same change. See #517. Same change as #517 (report missing or unreadable scan inputs in shader-info and translate), larger and with read errors still exiting 0; #517 is the tighter one. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
What
victory shader-infoandvictory translatediscardedWalkDirerrors andsilently skipped metadata and file-read failures. A mistyped explicit path
exited successfully with zero shader counts, and a failed read in a mixed
scan quietly undercounted coverage. Both commands now reject a path that does
not exist and report per-file input errors; an empty directory still scans
successfully.
An AI tool wrote part of this change.
Tested
cargo test --workspace: 168 passed, 0 failed, 3 ignored. Four CLI-level regressions: missing and empty-directory paths for both commands, asserting a named diagnostic and a nonzero result only for the missing path.cargo check --target x86_64-pc-windows-gnu --workspace --testspasses. No Windows host here.cargo xtask policypasses (150 files ok). No game files or data from them were added.Checklist
cargo xtask policypasses. No game files or data from them were added.