D3D12.X: newer-layout console list and allocator slot fixes (#126/#127, #148) #3727

Open
Kalmarv wants to merge 1 commit from upstream-pr/3727 into main
Kalmarv commented 2026-12-02 20:30:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T20:30:19Z.


Consolidates #3234 and #3235 into one clean, rebased PR (gpu:both: platform-independent D3D12.X command-list slot routing and x64 ABI). Both #3234 and #3235 previously received verdict: safe to merge from @Foniass (#3234#issuecomment-7257709751, #3235#issuecomment-7257708546) and will be closed once this replacement PR is open.

What is in it

  • Newer-layout RSSetShadingRate (#126) and RSSetShadingRateImage (#127) (crates/xcl/src/hle/d3d12x/real.rs):
    • main (real.rs:1494-1497) already remaps older console #124 -> PC #77 (RSSetShadingRate) and #125 -> PC #78 (RSSetShadingRateImage), and real.rs:11660-11663 documents newer #126/#127 as those two methods ahead of #129 DispatchMesh, but NEWER_LIST_SLOTS omitted (126, 124) and (127, 125). Without them, newer #126 fell into the console-extension stub and newer #127 fell through into older #127 (bind::dispatch_mesh).
    • Add (126, 124) and (127, 125) to NEWER_LIST_SLOTS, resolve targets via newer_list_target (checking console_slots then console_remap -> pc[1 + p]), and extend newer_layout_maps_dispatch_mesh_to_slot_129_not_128 to assert #126, #127, and #129 target resolution.
    • Scope relative to #1607 D187 overlap (#824, #1944): #824 and #1944 add capability-gated/sanitizing handlers for #126 (and #124 in #1944, plus restore_bindings) but do not cover #127 (RSSetShadingRateImage). This PR provides the minimal direct PC #77/#78 remap for both newer #126 and #127 (matching main's existing older-layout remap and stopping #127 from misrouting into DispatchMesh) without adding OPTIONS6 gating, rate clamping, or state restoration across splits; maintainers can take this minimal remap directly or layer a capability-gated #124/#126 handler on top while keeping (127, 125).
  • Command-list slot #148 32-bit UINT x64 ABI (crates/xcl/src/hle/d3d12x/bind.rs, console_list.rs, real.rs):
    • HANDOFF.md (:396-397, :410, :423, :436) names command-list slot #148 AllocateUploadMemory(size, alignment) -> CPU pointer (used by XboxBvhBuilder.dll and other console middleware).
    • Note on ABI provenance (raised by @Foniass on #3235): no public SDK header sources the 32-bit parameter widths; taking u32 size and align in bind::allocate_from_command_allocator_x and console_list::cl_allocate_upload_memory (widening to usize inside the body) is defensive x64 UINT register hygiene so non-zero upper 32 bits in rdx/r8 cannot turn a small allocation into a multi-GB failure.
    • Add unit test allocate_from_command_allocator_ignores_upper_32_register_bits covering both the default command-list hook (bind) and the console_list hook with poisoned upper register bits (0xDEAD_BEEF_0000_0040, 0xCAFE_BABE_0000_0020).

Tested

  • Hardware / toolchain: NVIDIA GeForce RTX 5070 Ti (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro (build 26200), rustc 1.99.0 (b940084d7 2026-09-28), DXC 1.9.2609.5 (XCL_DXC_DIR for builds/tests; Windows SDK DXC for scripts/smoke.ps1).
  • Release build warning check (cargo build --release -p xcl): origin/main (5ad98adbc) = 39 warnings; PR head (7d99466f5) = 39 warnings (0 new warnings).
  • Full suite (.\scripts\test.ps1 — runs cargo build --workspace, cargo bench -p xcl --bench '*' -- --test, and cargo test --workspace -- --test-threads=4): 44 targets, 3006 passed, 0 failed, 52 ignored, 24 SKIPPED (22 no wave64 on RTX 5070 Ti, 2 no heap windows). Both new/updated unit tests ran and passed:
    • hle::d3d12x::real::queue_tests::newer_layout_maps_dispatch_mesh_to_slot_129_not_128 ... ok
    • hle::d3d12x::console_list::tests::allocate_from_command_allocator_ignores_upper_32_register_bits ... ok
  • Retail 60 s scripts/smoke.ps1 (title: ea3b5e4d, release): origin/main (5ad98adbc) logged [STUB] d3d12_xs.dll!ID3D12GraphicsCommandList10::#126 (not on PC); PR head (7d99466f5) logged 0 #126 stub warnings and ran cleanly (exit: 0x0, 0 device removals, 0 crashes).

Regression run
main (5ad98adbc360225ac8a57ad9661e16fe8df9d8dd):

xcl-smoke v1
commit: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1161 (PresentX 1162)
presents per 2 s (last 3): 91 91 118
device removals: 0
crashes: 0
peak commit: 15885 MB

PR head (7d99466f5ec5feaa94843440e111c096e9c170fd):

xcl-smoke v1
commit: 7d99466f5ec5feaa94843440e111c096e9c170fd
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1078 (PresentX 1078)
presents per 2 s (last 3): 60 61 63
device removals: 0
crashes: 0
peak commit: 15157 MB

Not tested

  • AMD RDNA / Intel Arc GPUs and adapters without VRS support (no capability-gating/clamping added here; matches main's existing #124/#125 direct remap).
  • Console-only RSSetShadingRateX (#128) and live #127 (RSSetShadingRateImage) / #148 (AllocateUploadMemory) calls in a retail title (ea3b5e4d called #126, not #127 or #148, during the 60 s smoke).
  • XCL_SAMPLE_* tests (unset on this run) and the 24 skipped GPU tests (22 wave64, 2 heap windows).

AI use

  • Antigravity (Gemini 4 Neon) consolidated #3234 and #3235 onto origin/main (5ad98adbc), ran release warning parity checks, full .\scripts\test.ps1, paired 60 s scripts/smoke.ps1 runs, scripts/pr_check.py --local, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5614171752 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3727). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T20:30:19Z. --- Consolidates #3234 and #3235 into one clean, rebased PR (`gpu:both`: platform-independent D3D12.X command-list slot routing and x64 ABI). Both #3234 and #3235 previously received `verdict: safe to merge` from @Foniass (#3234#issuecomment-7257709751, #3235#issuecomment-7257708546) and will be closed once this replacement PR is open. **What is in it** - **Newer-layout `RSSetShadingRate` (#126) and `RSSetShadingRateImage` (#127)** (`crates/xcl/src/hle/d3d12x/real.rs`): - `main` (`real.rs:1494-1497`) already remaps older console `#124 -> PC #77` (`RSSetShadingRate`) and `#125 -> PC #78` (`RSSetShadingRateImage`), and `real.rs:11660-11663` documents newer `#126`/`#127` as those two methods ahead of `#129` `DispatchMesh`, but `NEWER_LIST_SLOTS` omitted `(126, 124)` and `(127, 125)`. Without them, newer `#126` fell into the console-extension stub and newer `#127` fell through into older `#127` (`bind::dispatch_mesh`). - Add `(126, 124)` and `(127, 125)` to `NEWER_LIST_SLOTS`, resolve targets via `newer_list_target` (checking `console_slots` then `console_remap -> pc[1 + p]`), and extend `newer_layout_maps_dispatch_mesh_to_slot_129_not_128` to assert `#126`, `#127`, and `#129` target resolution. - **Scope relative to #1607 D187 overlap (#824, #1944):** #824 and #1944 add capability-gated/sanitizing handlers for `#126` (and `#124` in #1944, plus `restore_bindings`) but do not cover `#127` (`RSSetShadingRateImage`). This PR provides the minimal direct PC `#77`/`#78` remap for **both** newer `#126` and `#127` (matching `main`'s existing older-layout remap and stopping `#127` from misrouting into `DispatchMesh`) without adding `OPTIONS6` gating, rate clamping, or state restoration across splits; maintainers can take this minimal remap directly or layer a capability-gated `#124`/`#126` handler on top while keeping `(127, 125)`. - **Command-list slot #148 32-bit `UINT` x64 ABI** (`crates/xcl/src/hle/d3d12x/bind.rs`, `console_list.rs`, `real.rs`): - `HANDOFF.md` (`:396-397`, `:410`, `:423`, `:436`) names command-list slot `#148` `AllocateUploadMemory(size, alignment) -> CPU pointer` (used by `XboxBvhBuilder.dll` and other console middleware). - Note on ABI provenance (raised by @Foniass on #3235): no public SDK header sources the 32-bit parameter widths; taking `u32` `size` and `align` in `bind::allocate_from_command_allocator_x` and `console_list::cl_allocate_upload_memory` (widening to `usize` inside the body) is defensive x64 `UINT` register hygiene so non-zero upper 32 bits in `rdx`/`r8` cannot turn a small allocation into a multi-GB failure. - Add unit test `allocate_from_command_allocator_ignores_upper_32_register_bits` covering both the default command-list hook (`bind`) and the `console_list` hook with poisoned upper register bits (`0xDEAD_BEEF_0000_0040`, `0xCAFE_BABE_0000_0020`). **Tested** - Hardware / toolchain: NVIDIA GeForce RTX 5070 Ti (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro (build 26200), `rustc 1.99.0 (b940084d7 2026-09-28)`, DXC `1.9.2609.5` (`XCL_DXC_DIR` for builds/tests; Windows SDK DXC for `scripts/smoke.ps1`). - Release build warning check (`cargo build --release -p xcl`): `origin/main` (`5ad98adbc`) = 39 warnings; PR head (`7d99466f5`) = 39 warnings (**0 new warnings**). - Full suite (`.\scripts\test.ps1` — runs `cargo build --workspace`, `cargo bench -p xcl --bench '*' -- --test`, and `cargo test --workspace -- --test-threads=4`): **44 targets, 3006 passed, 0 failed, 52 ignored, 24 SKIPPED** (22 no wave64 on RTX 5070 Ti, 2 no heap windows). Both new/updated unit tests ran and passed: - `hle::d3d12x::real::queue_tests::newer_layout_maps_dispatch_mesh_to_slot_129_not_128 ... ok` - `hle::d3d12x::console_list::tests::allocate_from_command_allocator_ignores_upper_32_register_bits ... ok` - Retail 60 s `scripts/smoke.ps1` (`title: ea3b5e4d`, release): `origin/main` (`5ad98adbc`) logged `[STUB] d3d12_xs.dll!ID3D12GraphicsCommandList10::#126 (not on PC)`; PR head (`7d99466f5`) logged 0 `#126` stub warnings and ran cleanly (`exit: 0x0`, 0 device removals, 0 crashes). **Regression run** main (`5ad98adbc360225ac8a57ad9661e16fe8df9d8dd`): ``` xcl-smoke v1 commit: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1161 (PresentX 1162) presents per 2 s (last 3): 91 91 118 device removals: 0 crashes: 0 peak commit: 15885 MB ``` PR head (`7d99466f5ec5feaa94843440e111c096e9c170fd`): ``` xcl-smoke v1 commit: 7d99466f5ec5feaa94843440e111c096e9c170fd gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1078 (PresentX 1078) presents per 2 s (last 3): 60 61 63 device removals: 0 crashes: 0 peak commit: 15157 MB ``` **Not tested** - AMD RDNA / Intel Arc GPUs and adapters without VRS support (no capability-gating/clamping added here; matches `main`'s existing `#124`/`#125` direct remap). - Console-only `RSSetShadingRateX` (`#128`) and live `#127` (`RSSetShadingRateImage`) / `#148` (`AllocateUploadMemory`) calls in a retail title (`ea3b5e4d` called `#126`, not `#127` or `#148`, during the 60 s smoke). - `XCL_SAMPLE_*` tests (unset on this run) and the 24 skipped GPU tests (22 wave64, 2 heap windows). **AI use** - Antigravity (Gemini 4 Neon) consolidated #3234 and #3235 onto `origin/main` (`5ad98adbc`), ran release warning parity checks, full `.\scripts\test.ps1`, paired 60 s `scripts/smoke.ps1` runs, `scripts/pr_check.py --local`, and drafted this PR description.
mokkamokacaffe commented 2026-12-03 00:50:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mokkamokacaffe on 2026-12-03T00:50:34Z.

Review: APPROVED


Implements AllocateFromCommandAllocatorX with the Windows x64 ABI.
Size and alignment are UINT arguments. Read each as u32 before
widening to usize, because the upper 32 register bits are unspecified.

AI: OpenAI Codex (GPT-6, specific revision unavailable) review.

<!-- greyfinch-sync:ivall/xcl:review:6161757745 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3727#pullrequestreview-6161757745). Originally posted by [mokkamokacaffe](https://github.com/mokkamokacaffe) on 2026-12-03T00:50:34Z. **Review:** APPROVED --- Implements `AllocateFromCommandAllocatorX` with the Windows x64 ABI. Size and alignment are `UINT` arguments. Read each as `u32` before widening to `usize`, because the upper 32 register bits are unspecified. AI: OpenAI Codex (GPT-6, specific revision unavailable) review.
jsalzy commented 2026-12-03 01:18:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-03T01:18:19Z.


merge-check claim
head: 7d99466f5e

<!-- greyfinch-sync:ivall/xcl:comment:7364190279 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3727#issuecomment-7364190279). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-12-03T01:18:19Z. --- merge-check claim head: 7d99466f5ec5feaa94843440e111c096e9c170fd
jsalzy commented 2026-12-03 01:24:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-03T01:24:13Z.


merge-check
base: 078358a058
head: 7d99466f5e
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3007 passed, 0 failed, 52 ignored (44 test binaries); SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none. The PR's new test allocate_from_command_allocator_ignores_upper_32_register_bits and the extended newer_layout_maps_dispatch_mesh_to_slot_129_not_128 ran and passed. git diff --check clean; 39 compiler warnings, the same as main.
title run: not run
review: (1) The 32-bit width of #148's size and alignment isn't sourced: as the PR itself notes, no public SDK header gives them. If they were 64-bit, a request of 4 GiB or more would be truncated (unlikely for upload memory, but unverified). (2) Newer-layout #126/#127 now go straight to the PC's RSSetShadingRate / RSSetShadingRateImage (#77 / #78), with no OPTIONS6 (VRS tier) check. That's the same as main's existing older-layout remap of #124/#125, and open #824 / #1944 add a check for #126; on a GPU without VRS these calls are invalid either way. (3) The #126/#127 test checks the slot table (newer_list_target), not a call through a real newer-layout command list. Checked and fine: newer_list_target (real.rs) uses the console handler if there is one, else console_remap -> pc[1 + p], where pc is class_for's copy of the vtable taken before any remap; the lookup is bounds-checked with get(). Newer #129 still resolves to DispatchMesh, and #127 no longer lands there. Only the two vtable entries for #148 (real.rs:1701, console_list.rs:708) take the u32 ABI; the internal callers of allocate_upload_memory (bind.rs:4113, list_x.rs:5955) call the Rust function directly. The new test calls both #148 hooks through a u64 signature with junk in the upper halves and gets aligned memory back. Duplicates: this PR combines the author's closed #3234 (its real.rs change exactly) and closed #3235 (#148). #3234 was in #1607 group D187 with open #824 and #1944, which handle newer #126 differently (a VRS-checked handler and a sanitizing handler); neither covers #127 or #148. Not the same change, so this belongs in D187 in #3234's place.
performance: none (reasoned): it only changes which function sits at newer-layout slots #126/#127 and the argument width at #148.
verdict: safe to merge: small and correct as read, the suite passes, and it carries over closed #3234 and #3235. Open #824 / #1944 (D187) handle #126 another way.
hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build and suite run on this PC with git and cargo only; diff review by Claude Opus 5.5.

<!-- greyfinch-sync:ivall/xcl:comment:7364303076 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3727#issuecomment-7364303076). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-12-03T01:24:13Z. --- merge-check base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a head: 7d99466f5ec5feaa94843440e111c096e9c170fd merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3007 passed, 0 failed, 52 ignored (44 test binaries); SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none. The PR's new test allocate_from_command_allocator_ignores_upper_32_register_bits and the extended newer_layout_maps_dispatch_mesh_to_slot_129_not_128 ran and passed. git diff --check clean; 39 compiler warnings, the same as main. title run: not run review: (1) The 32-bit width of #148's size and alignment isn't sourced: as the PR itself notes, no public SDK header gives them. If they were 64-bit, a request of 4 GiB or more would be truncated (unlikely for upload memory, but unverified). (2) Newer-layout #126/#127 now go straight to the PC's RSSetShadingRate / RSSetShadingRateImage (#77 / #78), with no OPTIONS6 (VRS tier) check. That's the same as main's existing older-layout remap of #124/#125, and open #824 / #1944 add a check for #126; on a GPU without VRS these calls are invalid either way. (3) The #126/#127 test checks the slot table (newer_list_target), not a call through a real newer-layout command list. Checked and fine: newer_list_target (real.rs) uses the console handler if there is one, else console_remap -> pc[1 + p], where pc is class_for's copy of the vtable taken before any remap; the lookup is bounds-checked with get(). Newer #129 still resolves to DispatchMesh, and #127 no longer lands there. Only the two vtable entries for #148 (real.rs:1701, console_list.rs:708) take the u32 ABI; the internal callers of allocate_upload_memory (bind.rs:4113, list_x.rs:5955) call the Rust function directly. The new test calls both #148 hooks through a u64 signature with junk in the upper halves and gets aligned memory back. Duplicates: this PR combines the author's closed #3234 (its real.rs change exactly) and closed #3235 (#148). #3234 was in #1607 group D187 with open #824 and #1944, which handle newer #126 differently (a VRS-checked handler and a sanitizing handler); neither covers #127 or #148. Not the same change, so this belongs in D187 in #3234's place. performance: none (reasoned): it only changes which function sits at newer-layout slots #126/#127 and the argument width at #148. verdict: safe to merge: small and correct as read, the suite passes, and it carries over closed #3234 and #3235. Open #824 / #1944 (D187) handle #126 another way. hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build and suite run on this PC with git and cargo only; diff review by Claude Opus 5.5.
vasanex commented 2026-12-03 02:15:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-12-03T02:15:00Z.

Review: COMMENTED


Review of 7d99466f (code reading and the tests named below, not a merge-check) · no findings, 1 question

In short: the two new pairs give a newer-layout title PC RSSetShadingRate / RSSetShadingRateImage at #126 / #127, resolved from the same vtable copy (pc, taken after the overrides and before the splits) that the older layout's #124 / #125 already use. An older-layout title and the PC side keep what they had at those slots, because the split's older target is the entry that was there. None of the 23 existing pairs changes: each of their older slots has a console handler, so the new remap fallback is not reached for them. #148 has two vtable entries and both take the 32-bit arguments; the internal callers use the Rust function directly.

Result: no blockers found. From the code, nothing stands in the way of a merge. This is a review, not a merge-check: the suite and a title run are not covered here.

Measured (RTX 3080, merge of this head onto main 078358a0, debug)

  • cargo test -p xcl --lib -- newer_layout_maps_dispatch_mesh allocate_from_command_allocator_ignores: 2 passed, 0 failed.
  • With either #148 entry point taking usize again (one at a time), the new test fails ("bind #148 must ignore upper 32 bits…", "console_list #148 must ignore upper 32 bits…").

Question

  1. The two smoke blocks in the description: main shows 1161 frames and 91 / 91 / 118 presents per 2 s at the end, this head 1078 frames and 60 / 61 / 63. That is inside the 80 % rule, but this title is the one that calls #126, so on this head its shading-rate calls reach the driver for the first time, and the run got slower, not faster. Is that run-to-run variance (another loading phase at second 60), or does the title's rate now take effect in a way that costs frames? A second pair of runs would tell.

Note, not blocking

  1. newer_layout_maps_dispatch_mesh_to_slot_129_not_128 checks the table and newer_list_target on a made-up vector. It would also pass if class_for handed it &v (where #77 / #78 are already splits) or swapped the split's targets; the code does neither, the test just does not pin it. Read, not measured.

Not checked: the whole suite and a title run on this head (see the merge check); a live #126 / #127 / #148 call (the title on this machine was not run); adapters without variable-rate shading, which the description lists itself; the width of #148's arguments on the console, which the merge check already raised.

Review by Claude Code (Claude Fable 5.2), with an independent second read by a subagent (Claude Fable 5.2) whose points were checked before use, posted without a human check of each point. An automated PR review workflow is running at the request of the user.

<!-- greyfinch-sync:ivall/xcl:review:6162544130 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3727#pullrequestreview-6162544130). Originally posted by [vasanex](https://github.com/vasanex) on 2026-12-03T02:15:00Z. **Review:** COMMENTED --- **Review** of `7d99466f` (code reading and the tests named below, not a merge-check) · no findings, 1 question **In short:** the two new pairs give a newer-layout title PC `RSSetShadingRate` / `RSSetShadingRateImage` at #126 / #127, resolved from the same vtable copy (`pc`, taken after the overrides and before the splits) that the older layout's #124 / #125 already use. An older-layout title and the PC side keep what they had at those slots, because the split's `older` target is the entry that was there. None of the 23 existing pairs changes: each of their older slots has a console handler, so the new remap fallback is not reached for them. #148 has two vtable entries and both take the 32-bit arguments; the internal callers use the Rust function directly. **Result:** no blockers found. From the code, nothing stands in the way of a merge. This is a review, not a merge-check: the suite and a title run are not covered here. **Measured** (RTX 3080, merge of this head onto `main` `078358a0`, debug) - `cargo test -p xcl --lib -- newer_layout_maps_dispatch_mesh allocate_from_command_allocator_ignores`: 2 passed, 0 failed. - With either #148 entry point taking `usize` again (one at a time), the new test fails ("bind #148 must ignore upper 32 bits…", "console_list #148 must ignore upper 32 bits…"). **Question** 1. The two smoke blocks in the description: `main` shows 1161 frames and 91 / 91 / 118 presents per 2 s at the end, this head 1078 frames and 60 / 61 / 63. That is inside the 80 % rule, but this title is the one that calls #126, so on this head its shading-rate calls reach the driver for the first time, and the run got slower, not faster. Is that run-to-run variance (another loading phase at second 60), or does the title's rate now take effect in a way that costs frames? A second pair of runs would tell. **Note, not blocking** 1. `newer_layout_maps_dispatch_mesh_to_slot_129_not_128` checks the table and `newer_list_target` on a made-up vector. It would also pass if `class_for` handed it `&v` (where #77 / #78 are already splits) or swapped the split's targets; the code does neither, the test just does not pin it. Read, not measured. **Not checked:** the whole suite and a title run on this head (see the merge check); a live #126 / #127 / #148 call (the title on this machine was not run); adapters without variable-rate shading, which the description lists itself; the width of #148's arguments on the console, which the merge check already raised. Review by Claude Code (Claude Fable 5.2), with an independent second read by a subagent (Claude Fable 5.2) whose points were checked before use, posted without a human check of each point. An automated PR review workflow is running at the request of the user.
Kalmarv commented 2026-12-03 02:27:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T02:27:04Z.


Thanks for the review, @vasanex!

Re: Question 1 (smoke presents per 2 s 91 91 118 vs 60 61 63): on title: ea3b5e4d, earlier splash/loading phases present uncapped (~90–120 presents per 2 s) and the start screen caps at 30 fps (~60 presents per 2 s). So 60 61 63 at second 60 on 7d99466f5 is the normal capped menu rate rather than a slowdown from #126, while the main run was still in an uncapped loading/splash phase at second 60. (Noted: we did not run a second A/B pair on 7d99466f5 to confirm statistically.)

<!-- greyfinch-sync:ivall/xcl:comment:7365474681 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3727#issuecomment-7365474681). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T02:27:04Z. --- Thanks for the review, @vasanex! Re: Question 1 (smoke `presents per 2 s` `91 91 118` vs `60 61 63`): on `title: ea3b5e4d`, earlier splash/loading phases present uncapped (~90–120 presents per 2 s) and the start screen caps at 30 fps (~60 presents per 2 s). So `60 61 63` at second 60 on `7d99466f5` is the normal capped menu rate rather than a slowdown from `#126`, while the `main` run was still in an uncapped loading/splash phase at second 60. (Noted: we did not run a second A/B pair on `7d99466f5` to confirm statistically.)
Foniass commented 2026-12-03 05:27:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T05:27:48Z.


merge-check
base: 078358a058
head: 7d99466f5e
merge: clean
build: ok
tests: 3007 passed, 0 failed, 52 ignored; 28 skipped, the same as on main
review: 3 medium, 1 nit (below)
performance: 60 s smoke run: 1669 → 1672 frames (100 % of main), peak commit 17577 → 17866 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 230 s there, 0 device removals, 0 crashes, 2.9 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: safe to merge: no blocking finding (the points below are medium or nits), the suite passes and the smoke run is clean
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: Maps the newer-layout command-list slots #126/#127 to PC RSSetShadingRate/RSSetShadingRateImage, so #127 no longer runs DispatchMesh. It also reads the #148 AllocateUploadMemory size and alignment as 32-bit. The code is correct, both tests would fail without the change, and nothing blocks it; it replaces the closed #3234 and #3235, which both had safe-to-merge checks.

Medium

  1. Two unrelated fixes in one PR. The #126/#127 slot remap (real.rs) and the #148 32-bit ABI change (bind.rs, console_list.rs) have nothing to do with each other, and CONTRIBUTING asks for one logical change per PR. At 82 lines it is easy to review, but the description should say why they belong together, or they should be split.
  2. Newer #126/#127 call the PC VRS methods with no capability check. newer_list_target (real.rs ~11666) sends the title's calls straight to PC #77/#78, as main already does for the older layout. Those calls are invalid on adapters with no VRS, on Tier 1 (non-passthrough combiners, shading-rate image), or without AdditionalShadingRatesSupported (2x4, 4x2, 4x4). Newer-layout titles used to hit a stub here, so this is new on their default path. Open #824 and #1944 add OPTIONS6 gating for #126 (#824 also conflicts in real.rs), so decide which one lands.
  3. The 32-bit signature has no source. The doc comment at bind.rs ~4981 names AllocateFromCommandAllocatorX(UINT sizeBytes, UINT alignmentBytes), but the description admits nothing backs the UINT widths. This #3235 finding is still open. If the console takes SIZE_T, a request of 4 GiB or more is silently cut down. Say in the comment that the widths are assumed, or cite where they come from.

Nit

  1. Smoke pacing differs from main. The PR's run shows 1078 frames against 1161 on main (93 %), and the last presents are 60 61 63 against 91 91 118. That is within the limits and probably scene timing, but worth comparing in the gaming-PC run.
Checked and fine
  • Earlier finding fixed: AI use now names the tool and model (Antigravity, Gemini 4 Neon)
  • newer_list_target looks in console_slots first, then console_remap -> pc[1 + p] from the copy taken before the split, so newer #129 still gets dispatch_mesh and newer #127 gets PC #78
  • Renaming the loop's pc to pc_fn stops it shadowing the outer pc vector that the remap lookup now reads
  • allocate_upload_memory keeps its usize signature for the in-crate callers (bind.rs ~4113, list_x.rs ~5955); only the vtable entry takes u32
  • The new test puts garbage in the upper 32 bits of both registers for the bind and console_list hooks, and would fail on main (a multi-GB request returns null)
How this was tested
  • Merged onto main 078358a0, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 078358a0 and on this merge; presents per 2 s at the end: 60 60 61.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7368765939 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3727#issuecomment-7368765939). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T05:27:48Z. --- merge-check base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a head: 7d99466f5ec5feaa94843440e111c096e9c170fd merge: clean build: ok tests: 3007 passed, 0 failed, 52 ignored; 28 skipped, the same as on main review: 3 medium, 1 nit (below) performance: 60 s smoke run: 1669 → 1672 frames (100 % of main), peak commit 17577 → 17866 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 230 s there, 0 device removals, 0 crashes, 2.9 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: safe to merge: no blocking finding (the points below are medium or nits), the suite passes and the smoke run is clean hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** Maps the newer-layout command-list slots #126/#127 to PC RSSetShadingRate/RSSetShadingRateImage, so #127 no longer runs DispatchMesh. It also reads the #148 AllocateUploadMemory size and alignment as 32-bit. The code is correct, both tests would fail without the change, and nothing blocks it; it replaces the closed #3234 and #3235, which both had safe-to-merge checks. #### Medium 1. **Two unrelated fixes in one PR.** The #126/#127 slot remap (real.rs) and the #148 32-bit ABI change (bind.rs, console_list.rs) have nothing to do with each other, and CONTRIBUTING asks for one logical change per PR. At 82 lines it is easy to review, but the description should say why they belong together, or they should be split. 2. **Newer #126/#127 call the PC VRS methods with no capability check.** newer_list_target (real.rs ~11666) sends the title's calls straight to PC #77/#78, as main already does for the older layout. Those calls are invalid on adapters with no VRS, on Tier 1 (non-passthrough combiners, shading-rate image), or without AdditionalShadingRatesSupported (2x4, 4x2, 4x4). Newer-layout titles used to hit a stub here, so this is new on their default path. Open #824 and #1944 add OPTIONS6 gating for #126 (#824 also conflicts in real.rs), so decide which one lands. 3. **The 32-bit signature has no source.** The doc comment at bind.rs ~4981 names AllocateFromCommandAllocatorX(UINT sizeBytes, UINT alignmentBytes), but the description admits nothing backs the UINT widths. This #3235 finding is still open. If the console takes SIZE_T, a request of 4 GiB or more is silently cut down. Say in the comment that the widths are assumed, or cite where they come from. #### Nit 4. **Smoke pacing differs from main.** The PR's run shows 1078 frames against 1161 on main (93 %), and the last presents are 60 61 63 against 91 91 118. That is within the limits and probably scene timing, but worth comparing in the gaming-PC run. <details><summary>Checked and fine</summary> - Earlier finding fixed: AI use now names the tool and model (Antigravity, Gemini 4 Neon) - newer_list_target looks in console_slots first, then console_remap -> pc[1 + p] from the copy taken before the split, so newer #129 still gets dispatch_mesh and newer #127 gets PC #78 - Renaming the loop's pc to pc_fn stops it shadowing the outer pc vector that the remap lookup now reads - allocate_upload_memory keeps its usize signature for the in-crate callers (bind.rs ~4113, list_x.rs ~5955); only the vtable entry takes u32 - The new test puts garbage in the upper 32 bits of both registers for the bind and console_list hooks, and would fail on main (a multi-GB request returns null) </details> <details><summary>How this was tested</summary> - Merged onto main `078358a0`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `078358a0` and on this merge; presents per 2 s at the end: 60 60 61. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3727:upstream-pr/3727'
git switch 'upstream-pr/3727'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3727'
git switch 'upstream-pr/3727'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3727'
git switch 'upstream-pr/3727'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3727'
git switch 'main'
git merge --squash 'upstream-pr/3727'
git switch 'main'
git merge --ff-only 'upstream-pr/3727'
git switch 'main'
git merge 'upstream-pr/3727'
git push origin 'main'
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
xcl-dev/xcl!3727
No description provided.