Shaders, GPU: read through addresses passed in two root constants (stacked on #489) #710

Closed
itsRevela wants to merge 5 commits from upstream-pr/710 into main
itsRevela commented 2026-11-24 07:12:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by itsRevela on 2026-11-24T07:12:24Z.


Depends on: #302 and #489 (this branch is on top of #489, which carries #302). The measured programs also need #294 and #709 to translate all the way.

What

Reads through a 64-bit address that the title passes as two root constants (low half, high half). This is the an address from a root parameter that is no address case from #614.

  • victory-shader, resource.rs
    • The tracker recognises the constant pair from its high half. It handles a pair at any dword, a pair across two parameters, and a pair with an added offset carried into the high half.
    • Nothing that's accepted today is diverted, and a constant used as an index is never taken for a pair.
  • victory-shader, emit
    • A global_load_*, an s_load_dword*, or an s_buffer_load_* on a descriptor built around the pair reads a raw root SRV, t<n> in a new ROOT_ADDRESS_SPACE. The list is HostShader::address_srvs.
    • Writes and typed views through such an address stop with specific reasons.
  • victory-gpu
    • One SRV root parameter per view. At every draw and dispatch, bind composes the address from the two constants' current values and binds it with root_view.
    • If the address is unset or below 0x10000, the draw is dropped: counted, noted and warned once. That's today's outcome for these programs.
    • The shader cache encodes the new list.

Why

In the opening cutscene, 8 compute programs stop at an address from a root parameter that is no address once #302 rewrites their spill-table loads. On main they stop earlier. None writes through the address: 7 first use it in a global_load, the others in s_load_dword.

I measured with the title, cutscene, in local builds:

build those 8 programs
#302 #489 all 8 stop at no address
+ this 0 stop at no address; 3 at root UAVs, 2 at typed root views, 2 at an address from a phi, 1 at another non-root address
+ this + #294 + #709 3 of the 8 translate (the scalar-load ones), with their pipelines accepted by the host; the rest stop at an address from a phi (2), another non-root address (1) and an LDS operation (1)

The GPU bound the views without errors in those runs.

Tested

Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 3070 Ti (driver 32.0.16.1088), Rust 1.98.1.

  • New tests (13, synthetic code words only):
    • pair layouts and negative cases in resource.rs;
    • the read routes and the stop reasons in lower.rs;
    • two GPU tests, a global_load and an s_load_dword through a pair, in valu_tests.rs, each checking the dword read on the hardware GPU and on WARP;
    • pair_address tests in draw.rs.
  • The fix matters. With pair detection disabled, the pair tests fail.
  • Crate checks:
    • cargo test -p victory-shader: 81 passed.
    • -p victory-gpu: 46 passed, 1 ignored; with diagnostics, 48 passed, 1 ignored.
    • cargo test --workspace: 278 passed (on the first commit).
    • cargo clippy -p victory-shader -p victory-gpu --tests: nothing in the changed files.
    • cargo fmt --check: victory-shader clean; victory-gpu 79, the same as main.
    • cargo xtask policy: ok.

Overlap with #294: this touches the same files (draw.rs, pipeline/host.rs, shader_cache.rs, the emit structs). I merged the two locally for the measurements above. The conflicts are parallel additions, except shader_cache decode, which must read the lists in the order encode writes them. Whichever lands second rebases.

Known limits:

  • A root view has no size, so only the 1 MiB from the address is refreshed.
  • An offset below the start of the address can't be reached.
  • There's no fallback address yet; an unset address drops the draw.

AI-assisted (Claude Code). The design was reviewed before implementation, and the title runs used my own copy; no game data is in this PR.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6576631054 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710). Originally posted by [itsRevela](https://github.com/itsRevela) on 2026-11-24T07:12:24Z. --- Depends on: #302 and #489 (this branch is on top of #489, which carries #302). The measured programs also need #294 and #709 to translate all the way. ## What Reads through a 64-bit address that the title passes as **two root constants** (low half, high half). This is the `an address from a root parameter that is no address` case from #614. - **`victory-shader`, `resource.rs`** - The tracker recognises the constant pair from its high half. It handles a pair at any dword, a pair across two parameters, and a pair with an added offset carried into the high half. - Nothing that's accepted today is diverted, and a constant used as an index is never taken for a pair. - **`victory-shader`, `emit`** - A `global_load_*`, an `s_load_dword*`, or an `s_buffer_load_*` on a descriptor built around the pair reads a raw root SRV, `t<n>` in a new `ROOT_ADDRESS_SPACE`. The list is `HostShader::address_srvs`. - Writes and typed views through such an address stop with specific reasons. - **`victory-gpu`** - One SRV root parameter per view. At every draw and dispatch, `bind` composes the address from the two constants' current values and binds it with `root_view`. - If the address is unset or below 0x10000, the draw is dropped: counted, noted and warned once. That's today's outcome for these programs. - The shader cache encodes the new list. ## Why In the opening cutscene, 8 compute programs stop at `an address from a root parameter that is no address` once #302 rewrites their spill-table loads. On `main` they stop earlier. None writes through the address: 7 first use it in a `global_load`, the others in `s_load_dword`. I measured with the title, cutscene, in local builds: | build | those 8 programs | |---|---| | #302 #489 | all 8 stop at `no address` | | + this | 0 stop at `no address`; 3 at root UAVs, 2 at typed root views, 2 at `an address from a phi`, 1 at another non-root address | | + this + #294 + #709 | **3 of the 8 translate** (the scalar-load ones), with their pipelines accepted by the host; the rest stop at `an address from a phi` (2), another non-root address (1) and an LDS operation (1) | The GPU bound the views without errors in those runs. ## Tested Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 3070 Ti (driver 32.0.16.1088), Rust 1.98.1. - **New tests** (13, synthetic code words only): - pair layouts and negative cases in `resource.rs`; - the read routes and the stop reasons in `lower.rs`; - two GPU tests, a `global_load` and an `s_load_dword` through a pair, in `valu_tests.rs`, each checking the dword read on the hardware GPU and on WARP; - `pair_address` tests in `draw.rs`. - **The fix matters.** With pair detection disabled, the pair tests fail. - **Crate checks:** - `cargo test -p victory-shader`: 81 passed. - `-p victory-gpu`: 46 passed, 1 ignored; with `diagnostics`, 48 passed, 1 ignored. - `cargo test --workspace`: 278 passed (on the first commit). - `cargo clippy -p victory-shader -p victory-gpu --tests`: nothing in the changed files. - `cargo fmt --check`: victory-shader clean; victory-gpu 79, the same as `main`. - `cargo xtask policy`: ok. **Overlap with #294:** this touches the same files (`draw.rs`, `pipeline/host.rs`, `shader_cache.rs`, the `emit` structs). I merged the two locally for the measurements above. The conflicts are parallel additions, except `shader_cache` decode, which must read the lists in the order `encode` writes them. Whichever lands second rebases. **Known limits:** - A root view has no size, so only the 1 MiB from the address is refreshed. - An offset below the start of the address can't be reached. - There's no fallback address yet; an unset address drops the draw. AI-assisted (Claude Code). The design was reviewed before implementation, and the title runs used my own copy; no game data is in this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
LAKSHYA-cmd-tech commented 2026-11-24 08:02:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T07:44:22Z.

Review: APPROVED


Verified on Windows 11 MSVC (Rust 1.98.1).

  • All 10 shader pair tests (\scalar_loads_through_a_root_constant_pair_read_its_root_srv, \global_loads_through_a_root_constant_pair_read_its_root_srv, root constant pair tracker tests) pass.
  • All \ ictory-gpu\ tests (\ddresses_in_root_constants_are_composed_from_both_halves,
    ull_and_low_addresses_are_unset, \shader_cache\ encode/decode) pass.
  • Correctly lowers 64-bit addresses passed via root constant pairs into raw root SRVs (\ \ in \ROOT_ADDRESS_SPACE), dropping dispatches cleanly if the address is unset or below \MIN_ADDRESS\ (0x10000).
  • Fully compliant with asset policy (\cargo xtask policy\ clean: 151 files).
<!-- greyfinch-sync:Marvisak/VIctory:review:6035430156 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#pullrequestreview-6035430156). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T07:44:22Z. **Review:** APPROVED --- Verified on Windows 11 MSVC (Rust 1.98.1). - All 10 shader pair tests (\scalar_loads_through_a_root_constant_pair_read_its_root_srv\, \global_loads_through_a_root_constant_pair_read_its_root_srv\, root constant pair tracker tests) pass. - All \ ictory-gpu\ tests (\ddresses_in_root_constants_are_composed_from_both_halves\, \ ull_and_low_addresses_are_unset\, \shader_cache\ encode/decode) pass. - Correctly lowers 64-bit addresses passed via root constant pairs into raw root SRVs (\ <n>\ in \ROOT_ADDRESS_SPACE\), dropping dispatches cleanly if the address is unset or below \MIN_ADDRESS\ (0x10000). - Fully compliant with asset policy (\cargo xtask policy\ clean: 151 files).
catminou4 commented 2026-11-24 09:06:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T08:05:38Z.

Review: COMMENTED


Heads-up: no longer merges cleanly with current main (7374bfb) — conflicts in victory-gpu/src/draw.rs, victory-shader/src/emit/lower.rs and valu_tests.rs. Needs a rebase.

For the record, the shader crate on the head passes on macOS 26 arm64 / rustc 1.98.1: cargo test -p victory-shader --locked → 66 passed / 0 failed (+2 ungated vs its base). The GPU-side behavior (two-root-constant buffer reads) still needs the Windows run.

<!-- greyfinch-sync:Marvisak/VIctory:review:6035653670 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#pullrequestreview-6035653670). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T08:05:38Z. **Review:** COMMENTED --- Heads-up: no longer merges cleanly with current main (`7374bfb`) — conflicts in `victory-gpu/src/draw.rs`, `victory-shader/src/emit/lower.rs` and `valu_tests.rs`. Needs a rebase. For the record, the shader crate on the head passes on macOS 26 arm64 / rustc 1.98.1: `cargo test -p victory-shader --locked` → **66 passed / 0 failed** (+2 ungated vs its base). The GPU-side behavior (two-root-constant buffer reads) still needs the Windows run.
raffclar commented 2026-11-24 09:06:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by raffclar on 2026-11-24T08:17:26Z.

Review: CHANGES_REQUESTED


No description provided.

<!-- greyfinch-sync:Marvisak/VIctory:review:6035700051 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#pullrequestreview-6035700051). Originally posted by [raffclar](https://github.com/raffclar) on 2026-11-24T08:17:26Z. **Review:** CHANGES_REQUESTED --- _No description provided._
raffclar commented 2026-11-24 09:06:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by raffclar on 2026-11-24T08:23:43Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:Marvisak/VIctory:review:6035859859 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#pullrequestreview-6035859859). Originally posted by [raffclar](https://github.com/raffclar) on 2026-11-24T08:23:43Z. **Review:** COMMENTED --- _No description provided._
raffclar commented 2026-11-24 09:06:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by raffclar on 2026-11-24T08:09:57Z.

Code review location: crates/victory-shader/src/emit/lower.rs; line 3351

@@ -3247,6 +3346,12 @@ impl<'a> Lower<'a> {
                     .layout
                     .get(address.param)
                     .ok_or("a descriptor built around a table in the code")?;
+                if rp.root == RootType::Constants {
+                    return match props.0 {
+                        11 => self.address_srv(address),

If a shader adds an offset to the address pair before a buffer load (such as pair + 0x100), the translation drops the offset

I would add the offset there too or refuse as non-zero offset

<!-- greyfinch-sync:Marvisak/VIctory:review-comment:4677150300 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#discussion_r4677150300). Originally posted by [raffclar](https://github.com/raffclar) on 2026-11-24T08:09:57Z. **Code review location:** `crates/victory-shader/src/emit/lower.rs`; line 3351 ~~~~diff @@ -3247,6 +3346,12 @@ impl<'a> Lower<'a> { .layout .get(address.param) .ok_or("a descriptor built around a table in the code")?; + if rp.root == RootType::Constants { + return match props.0 { + 11 => self.address_srv(address), ~~~~ --- If a shader adds an offset to the address pair before a buffer load (such as pair + 0x100), the translation drops the offset I would add the offset there too or refuse as non-zero offset
raffclar commented 2026-11-24 09:06:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by raffclar on 2026-11-24T08:10:31Z.

Code review location: crates/victory-shader/src/emit/lower.rs; line 3351

@@ -3247,6 +3346,12 @@ impl<'a> Lower<'a> {
                     .layout
                     .get(address.param)
                     .ok_or("a descriptor built around a table in the code")?;
+                if rp.root == RootType::Constants {
+                    return match props.0 {
+                        11 => self.address_srv(address),

Also the PR's tests only use an offset of zero so they miss this

<!-- greyfinch-sync:Marvisak/VIctory:review-comment:4677155700 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#discussion_r4677155700). Originally posted by [raffclar](https://github.com/raffclar) on 2026-11-24T08:10:31Z. **Code review location:** `crates/victory-shader/src/emit/lower.rs`; line 3351 ~~~~diff @@ -3247,6 +3346,12 @@ impl<'a> Lower<'a> { .layout .get(address.param) .ok_or("a descriptor built around a table in the code")?; + if rp.root == RootType::Constants { + return match props.0 { + 11 => self.address_srv(address), ~~~~ --- Also the PR's tests only use an offset of zero so they miss this
raffclar commented 2026-11-24 09:06:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by raffclar on 2026-11-24T08:17:21Z.

Code review location: crates/victory-gpu/src/pipeline/host.rs; line 395

@@ -382,6 +390,20 @@ impl HostPipeline {
                     });
                 }
             }
+            for (n, &view) in t.address_srvs.iter().enumerate() {
+                stage.address_srvs.push((view, params.len() as u32));
+                params.push(D3D12_ROOT_PARAMETER1 {

Check D3D12's limit of 64.

Count the u32s you're pushing. Consider using descriptor tables as fallback but tables have extra cost in the form of heap space on every draw so more work for the CPU.

Make sure to log the fallback i.e "root signature over 64 DWORDs" in the code for debugging

<!-- greyfinch-sync:Marvisak/VIctory:review-comment:4677219792 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#discussion_r4677219792). Originally posted by [raffclar](https://github.com/raffclar) on 2026-11-24T08:17:21Z. **Code review location:** `crates/victory-gpu/src/pipeline/host.rs`; line 395 ~~~~diff @@ -382,6 +390,20 @@ impl HostPipeline { }); } } + for (n, &view) in t.address_srvs.iter().enumerate() { + stage.address_srvs.push((view, params.len() as u32)); + params.push(D3D12_ROOT_PARAMETER1 { ~~~~ --- Check D3D12's limit of 64. Count the u32s you're pushing. Consider using descriptor tables as fallback but tables have extra cost in the form of heap space on every draw so more work for the CPU. Make sure to log the fallback i.e "root signature over 64 DWORDs" in the code for debugging
raffclar commented 2026-11-24 09:06:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by raffclar on 2026-11-24T08:23:43Z.

Code review location: crates/victory-gpu/src/pipeline/host.rs; line 395

@@ -382,6 +390,20 @@ impl HostPipeline {
                     });
                 }
             }
+            for (n, &view) in t.address_srvs.iter().enumerate() {
+                stage.address_srvs.push((view, params.len() as u32));
+                params.push(D3D12_ROOT_PARAMETER1 {

If the limit is never reached maybe a hard cap and error instead

<!-- greyfinch-sync:Marvisak/VIctory:review-comment:4677278255 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#discussion_r4677278255). Originally posted by [raffclar](https://github.com/raffclar) on 2026-11-24T08:23:43Z. **Code review location:** `crates/victory-gpu/src/pipeline/host.rs`; line 395 ~~~~diff @@ -382,6 +390,20 @@ impl HostPipeline { }); } } + for (n, &view) in t.address_srvs.iter().enumerate() { + stage.address_srvs.push((view, params.len() as u32)); + params.push(D3D12_ROOT_PARAMETER1 { ~~~~ --- If the limit is never reached maybe a hard cap and error instead
MartinIndra02 commented 2026-11-24 10:03:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MartinIndra02 on 2026-11-24T09:19:45Z.


Windows native D3D12 verification for a5a40bc (since @catminou4 noted the Windows GPU run was still needed):

  • Setup: Windows 11 Pro 26200, NVIDIA GeForce RTX 3080 (10 GB, driver 621.24), Ryzen 7 5800X3D, Rust 1.98.1 (x86_64-pc-windows-msvc).
  • cargo test -p victory-shader --lib -- --test-threads=1: 81 passed, 0 failed (including both root-constant-pair GPU tests).
  • cargo test -p victory-gpu --lib -- --test-threads=1: 46 passed, 0 failed, 1 ignored (including addresses_in_root_constants_are_composed_from_both_halves, an_address_with_a_missing_half_is_unset, and null_and_low_addresses_are_unset).

No game data used. AI-assisted; tests run on my machine.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7127262324 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7127262324). Originally posted by [MartinIndra02](https://github.com/MartinIndra02) on 2026-11-24T09:19:45Z. --- Windows native D3D12 verification for `a5a40bc` (since @catminou4 noted the Windows GPU run was still needed): - **Setup:** Windows 11 Pro 26200, NVIDIA GeForce RTX 3080 (10 GB, driver `621.24`), Ryzen 7 5800X3D, Rust 1.98.1 (`x86_64-pc-windows-msvc`). - `cargo test -p victory-shader --lib -- --test-threads=1`: **81 passed, 0 failed** (including both root-constant-pair GPU tests). - `cargo test -p victory-gpu --lib -- --test-threads=1`: **46 passed, 0 failed, 1 ignored** (including `addresses_in_root_constants_are_composed_from_both_halves`, `an_address_with_a_missing_half_is_unset`, and `null_and_low_addresses_are_unset`). *No game data used. AI-assisted; tests run on my machine.*
LAKSHYA-cmd-tech commented 2026-11-24 11:04:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T10:34:04Z.


Verified and resolved cleanly against the latest dynamic slot reclaim and root signature fallbacks in github.com/LAKSHYA-cmd-tech/VIctory@44aec54b83 (branch eature/root-constant-addresses).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7128952346 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7128952346). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T10:34:04Z. --- Verified and resolved cleanly against the latest dynamic slot reclaim and root signature fallbacks in https://github.com/LAKSHYA-cmd-tech/VIctory/commit/44aec54b83ea9a35e959ce5012a8069503dc08eb (branch eature/root-constant-addresses).
Zilumz1 commented 2026-11-24 11:04:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zilumz1 on 2026-11-24T10:34:36Z.


Rebase check against current main (AI-assisted, no game files)

This branch no longer merges cleanly into main at 8e79c80: 8 conflicts in draw.rs, lower.rs and valu_tests.rs. I resolved them and have a version that applies cleanly. The resolutions were:

draw.rs: kept main's bind -> bool, added this PR's bound flag and note_drop.
lower.rs and valu_tests.rs: both sides added tests in the same spot, so I kept both.

Results:

cargo test -p victory-shader (Linux, Rust 1.100.0): 80 passed, 0 failed, 1 ignored. Plain main gives 70 passed.
victory-gpu and the Windows-only GPU tests don't build on Linux, so those are unchecked there.
On my machine (Windows 10, RX 580)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7128964137 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7128964137). Originally posted by [Zilumz1](https://github.com/Zilumz1) on 2026-11-24T10:34:36Z. --- Rebase check against current main (AI-assisted, no game files) This branch no longer merges cleanly into main at 8e79c80: 8 conflicts in draw.rs, lower.rs and valu_tests.rs. I resolved them and have a version that applies cleanly. The resolutions were: draw.rs: kept main's bind -> bool, added this PR's bound flag and note_drop. lower.rs and valu_tests.rs: both sides added tests in the same spot, so I kept both. Results: cargo test -p victory-shader (Linux, Rust 1.100.0): 80 passed, 0 failed, 1 ignored. Plain main gives 70 passed. victory-gpu and the Windows-only GPU tests don't build on Linux, so those are unchecked there. On my machine (Windows 10, RX 580)
Zilumz1 commented 2026-11-24 11:04:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zilumz1 on 2026-11-24T10:47:12Z.


Test Results – victory-shader

I ran the following command locally:

cargo test -p victory-shader 2>&1 | Tee-Object with-patch.log

Results:

  • Passed: 105
  • Failed: 15
  • Ignored: 1
  • Total: 121

Failure analysis:

Most of the failures appear to be related to the test environment rather than immediately indicating regressions in the shader implementation.

The 13 failures under emit::valu_tests consistently report:

no SM 6.6 hardware device; skipped
no SM 6.6 warp device; skipped

neither hardware nor WARP SM 6.6 device available

This suggests that the environment does not currently expose a compatible Direct3D 12 Shader Model 6.6 hardware device or WARP fallback.

There are also two failures in emit::waterfall_tests:

  • lanes_sample_the_entry_their_offset_names_in_the_console_waterfall
  • lanes_sample_their_own_texture_in_a_waterfall_narrowed_by_v_cmpx

Both fail because their expected execution results are empty:

assertion failed: !results.is_empty()

These may be consequences of the same missing graphics execution environment, but that needs to be verified.

Conclusion:

The remaining 105 tests pass successfully. I would not classify these 15 failures as confirmed implementation regressions without first reproducing them in an environment with working SM 6.6 support.

It would be useful to determine whether these tests should gracefully skip when neither hardware nor WARP is available, rather than report environment-dependent failures.

I haven't established whether the two waterfall failures are exclusively environment-related, so those still warrant investigation.

Full test output is available in with-patch.log.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129243319 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7129243319). Originally posted by [Zilumz1](https://github.com/Zilumz1) on 2026-11-24T10:47:12Z. --- ### Test Results – `victory-shader` I ran the following command locally: ```powershell cargo test -p victory-shader 2>&1 | Tee-Object with-patch.log ``` **Results:** - Passed: 105 - Failed: 15 - Ignored: 1 - Total: 121 **Failure analysis:** Most of the failures appear to be related to the test environment rather than immediately indicating regressions in the shader implementation. The 13 failures under `emit::valu_tests` consistently report: ```text no SM 6.6 hardware device; skipped no SM 6.6 warp device; skipped neither hardware nor WARP SM 6.6 device available ``` This suggests that the environment does not currently expose a compatible Direct3D 12 Shader Model 6.6 hardware device or WARP fallback. There are also two failures in `emit::waterfall_tests`: - `lanes_sample_the_entry_their_offset_names_in_the_console_waterfall` - `lanes_sample_their_own_texture_in_a_waterfall_narrowed_by_v_cmpx` Both fail because their expected execution results are empty: ```text assertion failed: !results.is_empty() ``` These may be consequences of the same missing graphics execution environment, but that needs to be verified. **Conclusion:** The remaining 105 tests pass successfully. I would not classify these 15 failures as confirmed implementation regressions without first reproducing them in an environment with working SM 6.6 support. It would be useful to determine whether these tests should gracefully skip when neither hardware nor WARP is available, rather than report environment-dependent failures. I haven't established whether the two waterfall failures are exclusively environment-related, so those still warrant investigation. Full test output is available in `with-patch.log`.
DaviTostes commented 2026-11-24 12:04:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T11:08:20Z.


A/B tested a5a40bc on the full 1.0.2.1 dump (RX 9060 XT, RDNA4/RADV 26.3.1, Arch, Wine 11.22 + vkd3d-proton 3.2 + DXVK 3.1.1 dxgi, WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n"). Base main ffe310e.

Both sides are actual title runs with the game (menus → intro → loading → world), not synthetic shader tests.

Before (main): 81 unique untranslated shaders in the first ~2 minutes of the world. Top reason exactly the one this targets:

35x  an address in an SGPR that is no root parameter
 8x  a structured buffer of unknown stride
 6x  an address from a phi
 5x  a 64-bit image atomic

After (this branch): 82 unique untranslated shaders, but:

 0x  an address in an SGPR that is no root parameter
16x  a root UAV or typed root view
15x  an address not from a root parameter
 9x  an address from a phi
 8x  a structured buffer of unknown stride
 8x  a 64-bit image atomic

So the #1 reason from #293 is gone, and what remains matches your table's “+ this” row (root UAVs, typed root views, phi). The mesh pipeline still builds (host mesh pipeline shaders=[mesh d4111a6e…, pixel c0a7fe77…]) and the title reaches the world, but it is still the dark frozen background at 0.2–0.3 fps, so no visible change yet.

Later in the same run: RtlReleaseSRWLockExclusive … not owned exclusive! on several threads, then host GPU device removed … 0x887A0005 after a 7-list submission (the #774/#714 signature), ~3 minutes in.
Build details (per the report template): branch head a5a40bc on base main ffe310e, release build (cargo xwin build --release -p victory, MSVC); victory run prints build unknown (b99f876b…b5c35a79d5decd9f716504239e93), package 1.0.2.1. Same command as above.

Not tested: Windows, other GPUs, the #193/#539 stacks, and a full world session — the device was removed after ~3 minutes.

Next things worth stacking here: #193 (stride), #539/#305 (64-bit atomics), and whatever covers root UAVs/typed root views; I can A/B those on this dump if useful.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129705817 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7129705817). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T11:08:20Z. --- A/B tested `a5a40bc` on the full 1.0.2.1 dump (RX 9060 XT, RDNA4/RADV 26.3.1, Arch, Wine 11.22 + vkd3d-proton 3.2 + DXVK 3.1.1 `dxgi`, `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n"`). Base `main` `ffe310e`. Both sides are **actual title runs with the game** (menus → intro → loading → world), not synthetic shader tests. **Before (main):** 81 unique untranslated shaders in the first ~2 minutes of the world. Top reason exactly the one this targets: ``` 35x an address in an SGPR that is no root parameter 8x a structured buffer of unknown stride 6x an address from a phi 5x a 64-bit image atomic ``` **After (this branch):** 82 unique untranslated shaders, but: ``` 0x an address in an SGPR that is no root parameter 16x a root UAV or typed root view 15x an address not from a root parameter 9x an address from a phi 8x a structured buffer of unknown stride 8x a 64-bit image atomic ``` So the #1 reason from #293 is gone, and what remains matches your table's “+ this” row (root UAVs, typed root views, phi). The mesh pipeline still builds (`host mesh pipeline shaders=[mesh d4111a6e…, pixel c0a7fe77…]`) and the title reaches the world, but it is still the dark frozen background at 0.2–0.3 fps, so no visible change yet. Later in the same run: `RtlReleaseSRWLockExclusive … not owned exclusive!` on several threads, then `host GPU device removed … 0x887A0005` after a 7-list submission (the #774/#714 signature), ~3 minutes in. **Build details (per the report template):** branch head `a5a40bc` on base `main` `ffe310e`, release build (`cargo xwin build --release -p victory`, MSVC); `victory run` prints `build unknown (b99f876b…b5c35a79d5decd9f716504239e93)`, package 1.0.2.1. Same command as above. **Not tested:** Windows, other GPUs, the #193/#539 stacks, and a full world session — the device was removed after ~3 minutes. Next things worth stacking here: #193 (stride), #539/#305 (64-bit atomics), and whatever covers root UAVs/typed root views; I can A/B those on this dump if useful.
erLCoder commented 2026-11-24 14:04:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by erLCoder on 2026-11-24T13:09:00Z.


Independent root-constant address tests on GTX 1660 Ti, NVIDIA 581.42, Windows 10 22H2 build 19045.6466, Ryzen 5 3600, Rust 1.98.1 MSVC and Agility SDK 1.620.2. PR a5a40bc on #489 279eac1, which includes #302; #294 and #709 were not combined. Local SDK exports were added to the test executable and the fixture was restricted to the NVIDIA device, LUID 00000000:00017c52.

cargo test --offline --locked -p victory-shader --features host --lib through_a_root_constant_pair_read_its_root_srv -- --nocapture --test-threads=1 — 2 passed, 0 failed, 0 ignored, 79 filtered out. Both global and scalar load fixtures read the expected dword at byte offset 12. The fixture binds the buffer directly, so host address reconstruction during title dispatch remains untested, as do title shader recovery and composition.

Codex prepared the worktree, ran the tests and drafted this report.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132418244 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7132418244). Originally posted by [erLCoder](https://github.com/erLCoder) on 2026-11-24T13:09:00Z. --- Independent root-constant address tests on GTX 1660 Ti, NVIDIA 581.42, Windows 10 22H2 build 19045.6466, Ryzen 5 3600, Rust 1.98.1 MSVC and Agility SDK 1.620.2. PR a5a40bc on #489 279eac1, which includes #302; #294 and #709 were not combined. Local SDK exports were added to the test executable and the fixture was restricted to the NVIDIA device, LUID 00000000:00017c52. `cargo test --offline --locked -p victory-shader --features host --lib through_a_root_constant_pair_read_its_root_srv -- --nocapture --test-threads=1` — 2 passed, 0 failed, 0 ignored, 79 filtered out. Both global and scalar load fixtures read the expected dword at byte offset 12. The fixture binds the buffer directly, so host address reconstruction during title dispatch remains untested, as do title shader recovery and composition. Codex prepared the worktree, ran the tests and drafted this report.
qntic commented 2026-11-24 14:04:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by qntic on 2026-11-24T13:24:52Z.


found a register space conflict while integrating this with main ffe310e. ROOT_ADDRESS_SPACE and STRIDE_SPACE both use register space 2.

moved ROOT_ADDRESS_SPACE to space 3 in my integration branch. clippy and workspace tests pass with the combined changes.

integration:
https://github.com/qntic/VIctory/tree/exp4/main-stack

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132794400 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7132794400). Originally posted by [qntic](https://github.com/qntic) on 2026-11-24T13:24:52Z. --- found a register space conflict while integrating this with main ffe310e. ROOT_ADDRESS_SPACE and STRIDE_SPACE both use register space 2. moved ROOT_ADDRESS_SPACE to space 3 in my integration branch. clippy and workspace tests pass with the combined changes. integration: https://github.com/qntic/VIctory/tree/exp4/main-stack
fiestorra commented 2026-11-24 15:04:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-24T14:32:59Z.


Heads-up for anyone measuring this PR offline. On my own copy of the package (build b99f876b74d4a77f03af5f878223b27bd647b5c35a79d5decd9f716504239e93), whole-pack victory translate <shaders.rpf> --validate --list, clean worktrees and release builds:

  • at your head a5a40bc every count matches its merge base d2a4bae exactly: 21,971 programs validate, 185 are refused by the validator, 2,932 stop at emission, 594 stop during resource tracking;
  • no program moves to a different refusal and none newly validates;
  • the 195 programs stopped with an address in an SGPR that is no root parameter are 195 before and after, and all of them are GS_VoxelizeGeneric_* geometry programs — 0 of the 196 Gs programs validate in either build.

So this pack does not appear to contain whatever your commits change, and it contains 195 cases of the reason this row is usually described by, in a stage the row is not usually associated with. Table, method and the comparison against today's main in my comment here: https://github.com/Marvisak/VIctory/issues/293#issuecomment-7134545503

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7134557918 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7134557918). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-24T14:32:59Z. --- Heads-up for anyone measuring this PR offline. On my own copy of the package (build `b99f876b74d4a77f03af5f878223b27bd647b5c35a79d5decd9f716504239e93`), whole-pack `victory translate <shaders.rpf> --validate --list`, clean worktrees and release builds: - at your head `a5a40bc` every count matches its merge base `d2a4bae` exactly: 21,971 programs validate, 185 are refused by the validator, 2,932 stop at emission, 594 stop during resource tracking; - no program moves to a different refusal and none newly validates; - the 195 programs stopped with `an address in an SGPR that is no root parameter` are 195 before and after, and all of them are `GS_VoxelizeGeneric_*` geometry programs — 0 of the 196 `Gs` programs validate in either build. So this pack does not appear to contain whatever your commits change, and it contains 195 cases of the reason this row is usually described by, in a stage the row is not usually associated with. Table, method and the comparison against today's main in my comment here: https://github.com/Marvisak/VIctory/issues/293#issuecomment-7134545503 Written with an AI assistant.
luisaugustz commented 2026-11-24 19:04:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by luisaugustz on 2026-11-24T18:10:16Z.


In-game test on AMD (RX 9070 XT), #302 + #489 + #710: the runtime refusals of this class go from 34 programs to 1

Machine: RX 9070 XT (native 64-lane waves), Adrenalin 32.0.32029.2010, Ryzen 7 5800X, Windows 11 build 26300. Title 1.0.2.1, diag build, prologue world, VICTORY_SHADER_LOOP_LIMIT=256.

Tree: r4tedx integration/testers (92bc27b) + #638 for the drop accounting. Then this PR's diff, which carries #302 and #489, applied on top. It conflicted in 11 places with that tree (#493's bounded root SRV tables in draw.rs, and the waterfall proof in resource.rs). I resolved those by hand: bind() returns bound next to the root SRV tables, and resource tracking keeps both the waterfall proof and the root-constant pairs.

Runtime result (same scene, before and after; per-frame drops summed over the programs that do not translate, peak per program):

without with #302/#489/#710
programs that do not translate (world) 107 101
an address in an SGPR that is no root parameter 34 programs, ~7,390 dropped/frame 1 program, ~150/frame
total dropped/frame from untranslated programs ~9,140 ~4,890

As @Brazlucas measured on #489, most of the 34 now stop one step later:

  • a root UAV or typed root view: 18 programs, ~1,730/frame (needs #294/#709);
  • an address not from a root parameter: 29 programs, ~1,370/frame.

Stability: several world runs with this stack, up to 25 minutes, with no device removal from it. The world is still black on this card, for other reasons (see #71).

Note: offline victory translate --validate shows no change for this class, as expected. The rewrite depends on the root layout the title binds at run time.

AI-assisted (Claude Code): measured in-game on this machine with a diag build. Counts and hashes only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140259933 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7140259933). Originally posted by [luisaugustz](https://github.com/luisaugustz) on 2026-11-24T18:10:16Z. --- **In-game test on AMD (RX 9070 XT), #302 + #489 + #710: the runtime refusals of this class go from 34 programs to 1** **Machine:** RX 9070 XT (native 64-lane waves), Adrenalin 32.0.32029.2010, Ryzen 7 5800X, Windows 11 build 26300. Title 1.0.2.1, diag build, prologue world, `VICTORY_SHADER_LOOP_LIMIT=256`. **Tree:** r4tedx `integration/testers` (`92bc27b`) + #638 for the drop accounting. Then this PR's diff, which carries #302 and #489, applied on top. It conflicted in 11 places with that tree (#493's bounded root SRV tables in `draw.rs`, and the waterfall proof in `resource.rs`). I resolved those by hand: `bind()` returns `bound` next to the root SRV tables, and resource tracking keeps both the waterfall proof and the root-constant pairs. **Runtime result** (same scene, before and after; per-frame drops summed over the programs that do not translate, peak per program): | | without | with #302/#489/#710 | |---|---|---| | programs that do not translate (world) | 107 | 101 | | `an address in an SGPR that is no root parameter` | **34 programs, ~7,390 dropped/frame** | **1 program, ~150/frame** | | total dropped/frame from untranslated programs | ~9,140 | ~4,890 | As @Brazlucas measured on #489, most of the 34 now stop one step later: - `a root UAV or typed root view`: 18 programs, ~1,730/frame (needs #294/#709); - `an address not from a root parameter`: 29 programs, ~1,370/frame. **Stability:** several world runs with this stack, up to 25 minutes, with no device removal from it. The world is still black on this card, for other reasons (see #71). Note: offline `victory translate --validate` shows no change for this class, as expected. The rewrite depends on the root layout the title binds at run time. _AI-assisted (Claude Code): measured in-game on this machine with a diag build. Counts and hashes only._
upstream-sync closed this pull request 2026-11-25 01:04:53 +00:00
Marvisak commented 2026-11-25 01:07:51 +00:00 (Migrated from github.com)

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


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

Stacked on #489/#302. Addresses passed in two root constants are served in main by the raw-address page table (27c3dc9d, Lower::memory), builder programs included.

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:7148539874 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/710#issuecomment-7148539874). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:28:05Z. --- Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Stacked on #489/#302. Addresses passed in two root constants are served in main by the raw-address page table (27c3dc9d, Lower::memory), builder programs included. 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!710
No description provided.