CLI: report all varying descriptor-word opcodes in translation refusals #672

Closed
MichaelSmithAI wants to merge 5 commits from upstream-pr/672 into main
MichaelSmithAI commented 2026-11-24 06:31:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T06:31:39Z.


The census in #566 leaves 38 shaders at the same refusal when a descriptor read from the first lane depends on computed vector registers. This opt-in CLI report lets testers see which operations account for those shaders before choosing another compiler change. It incorporates the review on the contributor's fork.

The prerequisite #566 has merged into main. The Files changed tab now shows the diagnostic, its regression test, the CLI option and the README usage.

Run victory translate <local-path> --descriptor-failures on the same inputs as the census. Each row gives a program count, the first varying word's defining opcode, the opcode or source category for every varying word in descriptor order, and the source class of every descriptor word. The scan deduplicates inputs and records at most one refusal per program. The output contains aggregate categories only. This mode stops after resource tracking.

A source-built shader computes two separate descriptor words with OR and XOR. The regression checks both opcode positions, the six other word sources and the same refusal with diagnostics disabled. After merging main at ffe310e, the Linux shader library suite passed 97 tests with one ignored. Windows-target workspace Clippy passed with all targets and features using the pure Rust BLAKE3 backend. The asset policy passed for 154 files. The actual 38-program distribution awaits a tester with the local inputs.

AI assistance was used for implementation and verification.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6576089292 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/672). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T06:31:39Z. --- The census in #566 leaves 38 shaders at the same refusal when a descriptor read from the first lane depends on computed vector registers. This opt-in CLI report lets testers see which operations account for those shaders before choosing another compiler change. It incorporates the [review on the contributor's fork](https://github.com/r4tedx/VIctory/pull/4). The prerequisite #566 has merged into main. The Files changed tab now shows the diagnostic, its regression test, the CLI option and the README usage. Run `victory translate <local-path> --descriptor-failures` on the same inputs as the census. Each row gives a program count, the first varying word's defining opcode, the opcode or source category for every varying word in descriptor order, and the source class of every descriptor word. The scan deduplicates inputs and records at most one refusal per program. The output contains aggregate categories only. This mode stops after resource tracking. A source-built shader computes two separate descriptor words with OR and XOR. The regression checks both opcode positions, the six other word sources and the same refusal with diagnostics disabled. After merging main at `ffe310e`, the Linux shader library suite passed 97 tests with one ignored. Windows-target workspace Clippy passed with all targets and features using the pure Rust BLAKE3 backend. The asset policy passed for 154 files. The actual 38-program distribution awaits a tester with the local inputs. AI assistance was used for implementation and verification.
LAKSHYA-cmd-tech commented 2026-11-24 06:54:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:42:03Z.

Review: APPROVED


LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 99 tests in ictory-shader and integration tests in ictory pass cleanly. Opt-in --descriptor-failures CLI report cleanly categorizes varying descriptor-word opcodes without overhead on standard translation.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034787607 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/672#pullrequestreview-6034787607). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T06:42:03Z. **Review:** APPROVED --- LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 99 tests in ictory-shader and integration tests in ictory pass cleanly. Opt-in --descriptor-failures CLI report cleanly categorizes varying descriptor-word opcodes without overhead on standard translation.
catminou4 commented 2026-11-24 06:54:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:42:17Z.

Review: APPROVED


Verified locally on macOS 26 arm64, rustc 1.98.1 (aarch64-apple-darwin, rust-toolchain.toml):

  • cargo test -p victory-shader --locked at head d61daaa: 82 passed, 0 failed
  • cargo check -p victory --locked: clean — note main does not compile the app crate on macOS at all (the known host_resource cfg issue in victory-gpu, fixed by #235/#523), so I checked with #235's head merged in locally (uncommitted, only for verification). The translate.rs CLI changes compile and the shader side is fully tested.

Approving.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034789675 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/672#pullrequestreview-6034789675). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:42:17Z. **Review:** APPROVED --- Verified locally on macOS 26 arm64, rustc 1.98.1 (aarch64-apple-darwin, rust-toolchain.toml): - `cargo test -p victory-shader --locked` at head d61daaa: **82 passed, 0 failed** - `cargo check -p victory --locked`: clean — note main does not compile the app crate on macOS at all (the known `host_resource` cfg issue in victory-gpu, fixed by #235/#523), so I checked with #235's head merged in locally (uncommitted, only for verification). The translate.rs CLI changes compile and the shader side is fully tested. Approving.
MichaelSmithAI commented 2026-11-24 09:06:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T08:58:56Z.


Thanks @LAKSHYA-cmd-tech and @catminou4 for running the report and tests on Windows and macOS, and for documenting the extra macOS build dependency.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7126804508 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/672#issuecomment-7126804508). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T08:58:56Z. --- Thanks @LAKSHYA-cmd-tech and @catminou4 for running the report and tests on Windows and macOS, and for documenting the extra macOS build dependency.
ErRusso commented 2026-11-24 12:04:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ErRusso on 2026-11-24T11:23:32Z.


Audit: ✅ Looks good — verified & tested

Reviewed this PR as part of an audit of mergeable PRs.

  • Scope: apps/victory/src/translate.rs + crates/victory-shader/src/resource.rs (+183/-5). Adds --descriptor-failures flag to victory translate that aggregates DescriptorFailure records by opcode, varying opcode sequence, and descriptor-word source category — containing no program code, registers, or addresses. Useful for identifying shaders blocked by computed per-lane descriptors without the noise of full translation failure output.
  • Merges cleanly into main.
  • Tests: cargo test -p victory-shader -- resource::tests → 30/30 passed including the new computed_descriptor_failure_reports_only_opcode_and_word_sources which validates that synthetic v_or_b32 / v_xor_b32 instructions produce correctly categorized DescriptorFailure entries.
  • Data safety: The DescriptorFailure struct deliberately leaks no code bytes, register numbers, or addresses — just &'static str categories. descriptor_word_source() maps each word to one of "constant", "input", "phi", "scalar-load", "global-load", "buffer-load", "lds-read", "computed". Good.
  • UX note: The output format groups programs in a BTreeMap and prints count | opcode | varying_opcodes | sources — clean and useful for triaging.

No issues found.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7130036633 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/672#issuecomment-7130036633). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-24T11:23:32Z. --- ## Audit: ✅ Looks good — verified & tested Reviewed this PR as part of an audit of mergeable PRs. - **Scope:** `apps/victory/src/translate.rs` + `crates/victory-shader/src/resource.rs` (+183/-5). Adds `--descriptor-failures` flag to `victory translate` that aggregates `DescriptorFailure` records by opcode, varying opcode sequence, and descriptor-word source category — containing no program code, registers, or addresses. Useful for identifying shaders blocked by computed per-lane descriptors without the noise of full translation failure output. - **Merges cleanly** into `main`. - **Tests:** `cargo test -p victory-shader -- resource::tests` → **30/30 passed** including the new `computed_descriptor_failure_reports_only_opcode_and_word_sources` which validates that synthetic `v_or_b32` / `v_xor_b32` instructions produce correctly categorized `DescriptorFailure` entries. - **Data safety:** The `DescriptorFailure` struct deliberately leaks no code bytes, register numbers, or addresses — just `&'static str` categories. `descriptor_word_source()` maps each word to one of `"constant"`, `"input"`, `"phi"`, `"scalar-load"`, `"global-load"`, `"buffer-load"`, `"lds-read"`, `"computed"`. Good. - **UX note:** The output format groups programs in a BTreeMap and prints `count | opcode | varying_opcodes | sources` — clean and useful for triaging. No issues found.
upstream-sync closed this pull request 2026-11-25 01:04:44 +00:00
Marvisak commented 2026-11-25 01:07:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:27:15Z.


Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

the same opt-in CLI breakdown of 'a descriptor read from the first lane of computed VGPRs' (small argument changes, README section); that class went 38 -> 0 on the title's programs in main, so the report has nothing to show.

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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148526046 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/672#issuecomment-7148526046). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:27:15Z. --- Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. the same opt-in CLI breakdown of 'a descriptor read from the first lane of computed VGPRs' (small argument changes, README section); that class went 38 -> 0 on the title's programs in main, so the report has nothing to show. 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

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!672
No description provided.