Skip to content

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

Closed
MichaelSmithAI wants to merge 5 commits into
Marvisak:mainfrom
MichaelSmithAI:feature/computed-descriptor-report
Closed

MichaelSmithAI wants to merge 5 commits into
Marvisak:mainfrom
MichaelSmithAI:feature/computed-descriptor-report

Conversation

@MichaelSmithAI

@MichaelSmithAI MichaelSmithAI commented Nov 24, 2026 •

Copy link
Copy Markdown

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.

@LAKSHYA-cmd-tech LAKSHYA-cmd-tech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

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

ErRusso commented Nov 24, 2026

Copy link
Copy Markdown

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.

nazmi pushed a commit to nazmi/VIctory that referenced this pull request Nov 24, 2026
Merged by hand: the tracer gained an address-sum cache and a load-address helper since its base; those are kept beside the new descriptor-failure recorder, and test call sites pass the lanes argument the tracker gained. The PR tip is a merge of upstream main; only its feature change is taken.

Applied as the net diff of upstream PR Marvisak#672 (head ad434b4).
nazmi added a commit to nazmi/VIctory that referenced this pull request Nov 24, 2026
factory_methods_reject_null_out_without_leaking counts the scheduler's lanes before and after a refused queue creation. Every test that creates a queue through the factory added or removed a lane in that window, so the assertion failed intermittently when the suite ran in parallel - the gate was observed failing once and then passing five times in a row.

The scheduler is process-wide, so the tests that create a queue now hold a module lock, as audio's CONTEXT_TESTS does, and the counting test holds the same one. Twelve tests, one helper. Five consecutive runs of the crate are clean, and the full workspace gate passes: both Clippy commands, 544 passed / 11 ignored / 0 failed, policy 175 files.

Also in this change: the emit-dump policy test now passes the descriptor-failures argument that translate::run gained (PR Marvisak#672), and .gitignore excludes the local progress report.
@Marvisak

Copy link
Copy Markdown
Owner

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.

@Marvisak Marvisak closed this Nov 25, 2026
geiyiliyabumo pushed a commit to geiyiliyabumo/VIctory that referenced this pull request Nov 25, 2026
…view-616-111a

GPU: narrow host SRVs of streamed textures to resident mips (Marvisak#616)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants