shader: say which descriptor dword changed after loading and how #131

Merged
Olima34 merged 2 commits from upstream-pr/131 into main 2026-11-26 19:01:43 +00:00
Olima34 commented 2026-11-26 18:02:56 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-26T18:02:56Z.


A refusal split, like #118: it names the form instead of lowering it.

Why. "a descriptor changed after loading" is the largest unclaimed shader refusal in the newest tester log (#123, commit 182c14f): 34 unique compute shaders. The message doesn't say what changed, so there is nothing safe to lower yet. The V# layout (RDNA2 ISA §8.1.5) allows several candidate forms (a base-address offset, a changed num_records, a merged control word), and each needs different host support.

What. In resource.rs, the classifier (Tracer::changed) takes the s_load of the first loaded dword as the reference. It finds the first dword that is no longer that load's next one and names what made it, after the same prefix so existing tallies still group them: a descriptor changed after loading: dword N followed by

  • is a constant;
  • comes from another load or place in it;
  • masked or merged (s_and, s_or, s_bfi...);
  • added to (s_add, s_sub...);
  • shifted, multiplied or extracted (s_lshl, s_mul, s_bfe...);
  • chosen by a select or a join;
  • is a program input;
  • computed otherwise.

The strings are static (concat! over N = 0..7). There is no panic path: without a reference or a mismatch it falls back to "dword 0 comes from another load". Nothing new is lowered.

Tests.

  • New: a_descriptor_changed_after_loading_says_which_dword_and_how checks s_mov s10, 64 → "dword 2 is a constant", and s_add/s_addc on s[8:9] → "dword 0 added to". It fails on main.
  • Updated: the two resource.rs tests that asserted the old text. The old exact text appears nowhere else in crates/, Windows-only tests included.

victory-shader and victory-gpu tests (arm64), Windows clippy and cargo xtask policy pass. Once a tester log on this commit names the dominant form, I'll lower that one.

Update: added a victory-gpu host-path test, pipeline::changed_descriptor_tests::the_host_refuses_a_descriptor_changed_after_loading_naming_the_dword. It builds the container from the title's compute pieces (compute_container), translates it with the host's own options (native::shaders::translate), and checks the refusal text. On main it fails with the old generic message. Rebased on current main.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5514962943 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/131). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-26T18:02:56Z. --- A refusal split, like #118: it names the form instead of lowering it. **Why.** "a descriptor changed after loading" is the largest unclaimed shader refusal in the newest tester log (#123, commit 182c14f): 34 unique compute shaders. The message doesn't say what changed, so there is nothing safe to lower yet. The V# layout (RDNA2 ISA §8.1.5) allows several candidate forms (a base-address offset, a changed num_records, a merged control word), and each needs different host support. **What.** In `resource.rs`, the classifier (`Tracer::changed`) takes the `s_load` of the first loaded dword as the reference. It finds the first dword that is no longer that load's next one and names what made it, after the same prefix so existing tallies still group them: `a descriptor changed after loading: dword N` followed by - `is a constant`; - `comes from another load or place in it`; - `masked or merged (s_and, s_or, s_bfi...)`; - `added to (s_add, s_sub...)`; - `shifted, multiplied or extracted (s_lshl, s_mul, s_bfe...)`; - `chosen by a select or a join`; - `is a program input`; - `computed otherwise`. The strings are static (`concat!` over N = 0..7). There is no panic path: without a reference or a mismatch it falls back to "dword 0 comes from another load". Nothing new is lowered. **Tests.** - New: `a_descriptor_changed_after_loading_says_which_dword_and_how` checks `s_mov s10, 64` → "dword 2 is a constant", and `s_add`/`s_addc` on `s[8:9]` → "dword 0 added to". It fails on main. - Updated: the two `resource.rs` tests that asserted the old text. The old exact text appears nowhere else in `crates/`, Windows-only tests included. victory-shader and victory-gpu tests (arm64), Windows clippy and `cargo xtask policy` pass. Once a tester log on this commit names the dominant form, I'll lower that one. **Update:** added a victory-gpu host-path test, `pipeline::changed_descriptor_tests::the_host_refuses_a_descriptor_changed_after_loading_naming_the_dword`. It builds the container from the title's compute pieces (`compute_container`), translates it with the host's own options (`native::shaders::translate`), and checks the refusal text. On main it fails with the old generic message. Rebased on current main.
LakshanSivakumar commented 2026-11-26 18:56:17 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T18:56:17Z.

Review: APPROVED


Reviewed and tested together with the other open PRs on main (macOS x86_64 tests for shader, hle, loader and gpu, the setup shell tests, and Windows clippy). Thanks!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6079229103 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/131#pullrequestreview-6079229103). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T18:56:17Z. **Review:** APPROVED --- Reviewed and tested together with the other open PRs on main (macOS x86_64 tests for shader, hle, loader and gpu, the setup shell tests, and Windows clippy). Thanks!
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
LakshanSivakumar/Native-Victory-macOS!131
No description provided.