CLI: report shader scan input failures #534

Closed
github-bot wants to merge 3 commits from gh-pr/534/head into gh-pr/534/base
Owner

@⁠Quat3rnion on GitHub · 2026-11-24 04:35 UTC · original
Quat3rnion:victory-shader-scan-errors → main · +110 −13 · 4 files · 3 commits · closed without merging

What

victory shader-info and victory translate discarded WalkDir errors and
silently 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

  • Linux: 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.
  • Windows cross-build: cargo check --target x86_64-pc-windows-gnu --workspace --tests passes. No Windows host here.
  • cargo xtask policy passes (150 files ok). No game files or data from them were added.

Checklist

  • Workspace tests and Windows cross-check pass.
  • cargo xtask policy passes. No game files or data from them were added.
  • AI authorship is disclosed above.
**@⁠Quat3rnion** on GitHub · 2026-11-24 04:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/534) `Quat3rnion:victory-shader-scan-errors` → `main` · +110 −13 · 4 files · 3 commits · closed without merging ## What `victory shader-info` and `victory translate` discarded `WalkDir` errors and silently 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 - Linux: `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. - Windows cross-build: `cargo check --target x86_64-pc-windows-gnu --workspace --tests` passes. No Windows host here. - `cargo xtask policy` passes (150 files ok). No game files or data from them were added. ## Checklist - [x] Workspace tests and Windows cross-check pass. - [x] `cargo xtask policy` passes. No game files or data from them were added. - [x] AI authorship is disclosed above.
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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:07:24 +00:00
github-bot closed this pull request 2026-11-26 04:07:24 +00:00
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 11:48 UTC · original

Independent verification & code review on Windows 11 Pro (build 26100, Rust 1.98.1), cleanly merged onto main (ffe310e):

  • cargo xtask policy: PASS (154 files ok)
  • cargo test -p victory --locked: 5 passed, 0 failed (including all 4 new scan/translation missing-path and empty-dir tests)
  • cargo clippy --workspace --all-targets --locked -- -D warnings: FAIL (2 errors)

Findings

  • CI blocker (clippy::items-after-test-module): Both new test modules are placed before non-test items in their files, which fails clippy --all-targets -- -D warnings:
    1. apps/victory/src/shader.rs:244 (mod tests appears before format_instruction at line 265)
    2. apps/victory/src/translate.rs:156 (mod scan_tests appears before pub fn run and helpers at lines 177–717)
  • Moving both test modules to the bottom of their respective files (or merging scan_tests into translate.rs's existing trailing test module if present) resolves the CI failure. The scan error-reporting logic itself looks clean and useful.

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 11:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/534#issuecomment-7130582519) Independent verification & code review on Windows 11 Pro (build 26100, Rust `1.98.1`), cleanly merged onto `main` (`ffe310e`): - `cargo xtask policy`: PASS (`154 files ok`) - `cargo test -p victory --locked`: **5 passed, 0 failed** (including all 4 new scan/translation missing-path and empty-dir tests) - `cargo clippy --workspace --all-targets --locked -- -D warnings`: **FAIL** (2 errors) ### Findings - **CI blocker (`clippy::items-after-test-module`)**: Both new test modules are placed before non-test items in their files, which fails `clippy --all-targets -- -D warnings`: 1. `apps/victory/src/shader.rs:244` (`mod tests` appears before `format_instruction` at line 265) 2. `apps/victory/src/translate.rs:156` (`mod scan_tests` appears before `pub fn run` and helpers at lines 177–717) - Moving both test modules to the bottom of their respective files (or merging `scan_tests` into `translate.rs`'s existing trailing test module if present) resolves the CI failure. The scan error-reporting logic itself looks clean and useful. *AI-assisted; synthetic tests only, no game files.*
Author
Owner

@⁠Quat3rnion on GitHub · 2026-11-24 14:06 UTC · original

Fixed the blocking issue: committed the Cargo.lock update that records tempfile as a dev-dependency of apps/victory (new head 54b4402). cargo metadata --locked now succeeds, and I rebased onto current main (ffe310e). cargo test --workspace --no-fail-fast passes: 222 passed, 0 failed. Thanks for the clear triage — I kept this PR's semantics of 'missing root = hard error, per-file walk/read errors = report and continue' as you noted.

**@⁠Quat3rnion** on GitHub · 2026-11-24 14:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/534#issuecomment-7133862121) Fixed the blocking issue: committed the `Cargo.lock` update that records `tempfile` as a dev-dependency of `apps/victory` (new head `54b4402`). `cargo metadata --locked` now succeeds, and I rebased onto current main (`ffe310e`). `cargo test --workspace --no-fail-fast` passes: 222 passed, 0 failed. Thanks for the clear triage — I kept this PR's semantics of 'missing root = hard error, per-file walk/read errors = report and continue' as you noted.
Author
Owner

@⁠Quat3rnion on GitHub · 2026-11-24 14:19 UTC · original

@⁠geiyiliyabumo Thanks for the Windows clippy run. Fixed the clippy::items-after-test-module blocker in new head 29046af7: format_instruction now sits before shader.rs's test module, and scan_tests moved to the bottom of translate.rs. cargo test -p victory --locked passes all 4 scan/translation tests; cargo test --workspace --no-fail-fast passes 222/0. Could you re-run cargo clippy --workspace --all-targets --locked -- -D warnings on Windows when you get a chance?

**@⁠Quat3rnion** on GitHub · 2026-11-24 14:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/534#issuecomment-7134193383) @⁠geiyiliyabumo Thanks for the Windows clippy run. Fixed the `clippy::items-after-test-module` blocker in new head `29046af7`: `format_instruction` now sits before `shader.rs`'s test module, and `scan_tests` moved to the bottom of `translate.rs`. `cargo test -p victory --locked` passes all 4 scan/translation tests; `cargo test --workspace --no-fail-fast` passes 222/0. Could you re-run `cargo clippy --workspace --all-targets --locked -- -D warnings` on Windows when you get a chance?
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 14:31 UTC · original

Re-verified new head 29046af merged onto main ffe310e on Windows 11 x64 MSVC:

  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy --workspace --all-targets --locked -- -D warnings: PASS (0 warnings — both clippy::items-after-test-module blockers are resolved)
  • cargo clippy --workspace --all-targets --features diagnostics --locked -- -D warnings: PASS (0 warnings)
  • cargo test -p victory --locked: PASS (all unit + scan/translation tests green)

Looks clean and ready to merge!

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 14:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/534#issuecomment-7134515278) Re-verified new head `29046af` merged onto `main` `ffe310e` on Windows 11 x64 MSVC: - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy --workspace --all-targets --locked -- -D warnings`: **PASS** (0 warnings — both `clippy::items-after-test-module` blockers are resolved) - `cargo clippy --workspace --all-targets --features diagnostics --locked -- -D warnings`: **PASS** (0 warnings) - `cargo test -p victory --locked`: **PASS** (all unit + scan/translation tests green) Looks clean and ready to merge! *AI-assisted; synthetic tests only, no game files.*
Author
Owner

@⁠pickles976 on GitHub · 2026-11-24 18:38 UTC · original

The GPU Loc Sig mystery closes from the exe side — the name is encrypted, the watchdog IS the consumer, and the question changes. Decoding the function that owns the watchdog site (+0x23cf620, hash-matched copy):

call +0x2483ea0                     ; freshness/tick source → edx
<12 bytes 3b 45 4b 17 44 68 5d 1b 4f 66 65 ff, each + (12−i) at runtime>  → "GPU Loc Sig\0"
mov [result slot], 1                ; expected state
mov edx, tick; call +0x2215950      ; resolve the debug parameter "GPU Loc Sig"
cmp byte [rsp+0x34], 1
jne +0x23cf683                      ; null-write, imm 4d8bd421 — THE watchdog death

Three consequences, largest first:

  1. It was never a timer. The "watchdog" is a named-validation gate: every run ends because a debug parameter called GPU Loc Sig does not read as 1. That is why every string scan whiffed — the name is built by a 12-byte rolling obfuscation at runtime, so it appears in no .rdata and no binary grep, exactly matching both prior negative results (this board: 7333478d not a file constant; xcl side: "GPU Loc Sig" not in strings, yet it shows up in live debug-parameter logs — the log prints the deobfuscated name).
  2. Your 7333478d write is the same parameter's value channel — bvironn, your log captured writes to GPU Loc Sig with value 7333478d where the gate demands 1. Ask for the whole write-sequence of that name (every value + timestamp + call stack, if cheap): if some run ever shows 1 landing, that run is the first success condition ever observed; if it only ever shows signature-shaped values like 7333478d, the title is computing a location/completion signature that never matches, and the emulator-side diff target becomes what feeds that signature — GPU-visible placement of completed work, which sits precisely on top of the #549 read-too-early class and the never-completing-PSO class alike.
  3. The resolver +0x2215950 lives in the +0x2215xxx debug-parameter cluster whose global (+0x71b6348) and null-callback consumers are already on the kill-map — the gate and the two null-callback stops share the parameter service, consistent with one reporting/validation subsystem.

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: +0x23cf683 = GPU Loc Sig != 1 gate, trap imm 4d8bd421, obfuscated-name producer verified byte-exact (0x1b5d6844174b453b+0xff65664f, rolling +12..+1).

**@⁠pickles976** on GitHub · 2026-11-24 18:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/534#issuecomment-7140934833) **The `GPU Loc Sig` mystery closes from the exe side — the name is encrypted, the watchdog IS the consumer, and the question changes.** Decoding the function that owns the watchdog site (`+0x23cf620`, hash-matched copy): ``` call +0x2483ea0 ; freshness/tick source → edx <12 bytes 3b 45 4b 17 44 68 5d 1b 4f 66 65 ff, each + (12−i) at runtime> → "GPU Loc Sig\0" mov [result slot], 1 ; expected state mov edx, tick; call +0x2215950 ; resolve the debug parameter "GPU Loc Sig" cmp byte [rsp+0x34], 1 jne +0x23cf683 ; null-write, imm 4d8bd421 — THE watchdog death ``` Three consequences, largest first: 1. **It was never a timer.** The "watchdog" is a **named-validation gate**: every run ends because a debug parameter called `GPU Loc Sig` does not read as `1`. That is why every string scan whiffed — the name is built by a 12-byte rolling obfuscation at runtime, so it appears in no `.rdata` and no binary grep, exactly matching both prior negative results (this board: `7333478d` not a file constant; xcl side: "GPU Loc Sig" not in strings, yet it shows up in live debug-parameter logs — the log prints the **deobfuscated** name). 2. **Your `7333478d` write is the same parameter's value channel** — bvironn, your log captured writes to `GPU Loc Sig` with value `7333478d` where the gate demands `1`. Ask for the whole write-sequence of that name (every value + timestamp + call stack, if cheap): if some run ever shows `1` landing, that run is the first success condition ever observed; if it only ever shows signature-shaped values like `7333478d`, the title is computing a location/completion signature that never matches, and the emulator-side diff target becomes *what feeds that signature* — GPU-visible placement of completed work, which sits precisely on top of the #549 read-too-early class and the never-completing-PSO class alike. 3. **The resolver `+0x2215950` lives in the `+0x2215xxx` debug-parameter cluster** whose global (`+0x71b6348`) and null-callback consumers are already on the kill-map — the gate and the two null-callback stops share the parameter service, consistent with one reporting/validation subsystem. 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: `+0x23cf683` = `GPU Loc Sig != 1` gate, trap imm `4d8bd421`, obfuscated-name producer verified byte-exact (`0x1b5d6844174b453b`+`0xff65664f`, rolling +12..+1).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:04 UTC · original

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.

**@⁠Marvisak** on GitHub · 2026-11-25 00:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/534#issuecomment-7148100472) 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.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!534
No description provided.