Recompiler: share translated DXIL across repeated pipeline builds #2757

Open
kotekompotek wants to merge 1 commit from upstream-pr/2767 into main
kotekompotek commented 2026-11-26 11:24:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by kotekompotek on 2026-11-26T11:24:10Z.


Fixes #2609

console_to_dxil_in hands every caller shader.as_ref().clone() — including RAM hits — and Compiled owned its whole DXIL as a Vec<u8>, so every repeated pipeline build of one shader allocated and copied its whole translated bytes again. Building a dispatch chain then made another owned copy of the whole code for the fallback PSO.

Compiled.dxil is now an Arc<Vec<u8>>: the RAM-hit clone bumps a refcount and shares the cached bytes. The same sharing was carried to TwoPass.cs, dispatch_chain::Chain.whole_code (the build() parameter takes the Arc directly, dropping its whole.to_vec() copy) and the two-pass PS slots (two_pass_ps, ps_dxil). Call sites still see &[u8]/slice semantics through Deref; the only places that materialise a copy now are genuine producers (to_vec() on a &[u8] pass-through, the disk-cache Compiled construction).

What is in it

  • Compiled.dxil, TwoPass.cs: Vec<u8> -> Arc<Vec<u8>>
  • Chain.whole_code + dispatch_chain::build whole parameter: Arc<Vec<u8>> — one fewer whole-DXIL copy per chain build
  • two_pass_ps / ps_dxil: Option<Arc<Vec<u8>>>
  • Test: a_ram_hit_clone_shares_the_translated_bytes asserts storage identity (as_ptr) across 8 RAM hits — fails on main ("the RAM hit copied the whole DXIL"), passes here
  • shader_cache_skips_repeated_translation_and_disk_lookups: its deliberate mutation of the cloned dxil is replaced by an Arc::ptr_eq sharing assertion (callers only read the bytes)

Tested

GTX 1050, Windows 11, stable-x86_64-pc-windows-msvc.

  • cargo test -p xcl --lib a_ram_hit_clone_shares_the_translated_bytes — fails on b49be183 (storage differs), passes on the head
  • cargo test -p xcl --lib shader_cache_tests — 24 passed
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on a173e209 — 1432 passed / 4 failed / 47 ignored / 357 SKIPPED. Failures: the 3 known environment ones on this machine (gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark, stale_blob_cannot_bypass_the_offline_pipeline_cap, split_compute_program_prebuilds_and_caches_chain_pieces — GTX 1050 / SM 6.5 limits, failing on b49be183 too) plus terminate_manual_completion_port_with_delayed_async_does_not_deadlock, which passes on a quiet rerun (load flake under the parallel release build)
  • cargo build --release -p xcl on a173e209 — clean

Regression run

xcl-smoke v1 blocks, scripts/smoke.ps1 -Game "D:\GTA6.Xbox.v1.0.2.1", release build:

main b49be183:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce GTX 1050
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 0 (PresentX 0)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 1
peak commit: 5419 MB

head a173e209:

xcl-smoke v1
commit: a173e209151ff299a6a368df2b4e6c6c96f2ae3e
gpu: NVIDIA GeForce GTX 1050
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 0 (PresentX 0)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 789 MB

Not tested

GPU-level change in dispatch times (allocation savings are structural; no timing harness run). No behavioural change to emitted bytes, samplers or chains — all read-only consumers.

AI use

Devin (SWE-2 High) located the sites, wrote the change and the test, ran the suite, release build and smoke runs.

<!-- greyfinch-sync:ivall/xcl:issue:5509138329 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T11:24:10Z. --- Fixes #2609 `console_to_dxil_in` hands every caller `shader.as_ref().clone()` — including RAM hits — and `Compiled` owned its whole DXIL as a `Vec<u8>`, so every repeated pipeline build of one shader allocated and copied its whole translated bytes again. Building a dispatch chain then made another owned copy of the whole code for the fallback PSO. `Compiled.dxil` is now an `Arc<Vec<u8>>`: the RAM-hit clone bumps a refcount and shares the cached bytes. The same sharing was carried to `TwoPass.cs`, `dispatch_chain::Chain.whole_code` (the `build()` parameter takes the `Arc` directly, dropping its `whole.to_vec()` copy) and the two-pass PS slots (`two_pass_ps`, `ps_dxil`). Call sites still see `&[u8]`/slice semantics through `Deref`; the only places that materialise a copy now are genuine producers (`to_vec()` on a `&[u8]` pass-through, the disk-cache `Compiled` construction). **What is in it** - `Compiled.dxil`, `TwoPass.cs`: `Vec<u8>` -> `Arc<Vec<u8>>` - `Chain.whole_code` + `dispatch_chain::build` `whole` parameter: `Arc<Vec<u8>>` — one fewer whole-DXIL copy per chain build - `two_pass_ps` / `ps_dxil`: `Option<Arc<Vec<u8>>>` - Test: `a_ram_hit_clone_shares_the_translated_bytes` asserts storage identity (`as_ptr`) across 8 RAM hits — fails on `main` ("the RAM hit copied the whole DXIL"), passes here - `shader_cache_skips_repeated_translation_and_disk_lookups`: its deliberate mutation of the cloned `dxil` is replaced by an `Arc::ptr_eq` sharing assertion (callers only read the bytes) **Tested** GTX 1050, Windows 11, stable-x86_64-pc-windows-msvc. - `cargo test -p xcl --lib a_ram_hit_clone_shares_the_translated_bytes` — fails on `b49be183` (storage differs), passes on the head - `cargo test -p xcl --lib shader_cache_tests` — 24 passed - `cargo test --workspace --no-fail-fast -- --test-threads=4` on `a173e209` — 1432 passed / 4 failed / 47 ignored / 357 SKIPPED. Failures: the 3 known environment ones on this machine (`gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark`, `stale_blob_cannot_bypass_the_offline_pipeline_cap`, `split_compute_program_prebuilds_and_caches_chain_pieces` — GTX 1050 / SM 6.5 limits, failing on `b49be183` too) plus `terminate_manual_completion_port_with_delayed_async_does_not_deadlock`, which passes on a quiet rerun (load flake under the parallel release build) - `cargo build --release -p xcl` on `a173e209` — clean **Regression run** `xcl-smoke v1` blocks, `scripts/smoke.ps1 -Game "D:\GTA6.Xbox.v1.0.2.1"`, release build: main `b49be183`: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce GTX 1050 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 0 (PresentX 0) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 1 peak commit: 5419 MB ``` head `a173e209`: ``` xcl-smoke v1 commit: a173e209151ff299a6a368df2b4e6c6c96f2ae3e gpu: NVIDIA GeForce GTX 1050 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 0 (PresentX 0) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 789 MB ``` **Not tested** GPU-level change in dispatch times (allocation savings are structural; no timing harness run). No behavioural change to emitted bytes, samplers or chains — all read-only consumers. **AI use** Devin (SWE-2 High) located the sites, wrote the change and the test, ran the suite, release build and smoke runs.
KOLESNiii commented 2026-11-26 11:42:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T11:42:29Z.

Review: COMMENTED


The Vec<u8> → Arc<Vec<u8>> change looks right to me: every caller I checked only reads the bytes, and dispatch_chain::build no longer copies the whole code. Two test points inline.

Separately, the two smoke blocks aren't comparable: both show 0 frames shown, and main crashed with 5419 MB peak commit while the head stopped at 789 MB. That looks like the runs ended at different points, not a saving from this PR. A rerun of both that reaches frames would make the regression run meaningful.

Reviewed with Claude Code (Claude Opus 5.5); I checked each point against the PR head.

<!-- greyfinch-sync:ivall/xcl:review:6073543455 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#pullrequestreview-6073543455). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-26T11:42:29Z. **Review:** COMMENTED --- The `Vec<u8>` → `Arc<Vec<u8>>` change looks right to me: every caller I checked only reads the bytes, and `dispatch_chain::build` no longer copies the whole code. Two test points inline. Separately, the two smoke blocks aren't comparable: both show 0 frames shown, and `main` crashed with 5419 MB peak commit while the head stopped at 789 MB. That looks like the runs ended at different points, not a saving from this PR. A rerun of both that reaches frames would make the regression run meaningful. Reviewed with Claude Code (Claude Opus 5.5); I checked each point against the PR head.
KOLESNiii commented 2026-11-26 12:07:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T11:44:54Z.


Smoke run on a second machine (RTX 2070 SUPER, Windows 11, release builds, scripts/smoke.ps1, 60 s):

main b49be183:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 2070 SUPER
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1389 (PresentX 1390)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17748 MB

head a173e209:

xcl-smoke v1
commit: a173e209151ff299a6a368df2b4e6c6c96f2ae3e
gpu: NVIDIA GeForce RTX 2070 SUPER
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1454 (PresentX 1454)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16522 MB

No regression: both render at a steady 60 presents per 2 s with no crashes or device removals. Peak commit is ~1.2 GB lower on the head, which fits the shared DXIL. Only one run each, so read the frame-count and memory differences as indicative, not as measurements.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:comment:7191116078 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#issuecomment-7191116078). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-26T11:44:54Z. --- Smoke run on a second machine (RTX 2070 SUPER, Windows 11, release builds, `scripts/smoke.ps1`, 60 s): main `b49be183`: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 2070 SUPER title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1389 (PresentX 1390) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17748 MB ``` head `a173e209`: ``` xcl-smoke v1 commit: a173e209151ff299a6a368df2b4e6c6c96f2ae3e gpu: NVIDIA GeForce RTX 2070 SUPER title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1454 (PresentX 1454) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16522 MB ``` No regression: both render at a steady 60 presents per 2 s with no crashes or device removals. Peak commit is ~1.2 GB lower on the head, which fits the shared DXIL. Only one run each, so read the frame-count and memory differences as indicative, not as measurements. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MatyEjsr commented 2026-11-26 12:07:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MatyEjsr on 2026-11-26T11:52:06Z.


Independent SM 6.6 NVIDIA verification and paired 60 s regression run for PR #2767 at head a173e209151ff299a6a368df2b4e6c6c96f2ae3e (base main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7), covering the SM 6.6 tests and presenting title run that could not run on the author's GTX 1050.

Tested

  • Environment: Windows 11 Pro for Workstations 10.0.26200 (Developer Mode enabled), AMD Ryzen 7 7800X3D (8C/16T), 31.4 GB RAM, NVIDIA GeForce RTX 3090 (24 GiB VRAM, driver 617.42 / 32.0.16.1742, SM 6.6, wave32), rustc 1.100.0 (0ef1bc386 2026-11-09) (x86_64-pc-windows-msvc), DXC 1.9.2602.17 (dxcompiler.dll / dxil.dll), debug and release profiles. XCL_SAMPLE_* unset.
  • cargo build --workspace -j 8 (debug) and cargo build --release --workspace -j 8 (release): both succeeded with 0 errors.
  • cargo test -p xcl --lib shader_cache_tests -- --test-threads=1 --nocapture: 24 passed, 0 failed, 0 ignored, 0 SKIPPED (0.32 s), including a_ram_hit_clone_shares_the_translated_bytes and shader_cache_skips_repeated_translation_and_disk_lookups.
  • Targeted rerun of the 4 tests that failed on the author's GTX 1050 (cargo test --workspace -j 8 -- gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark stale_blob_cannot_bypass_the_offline_pipeline_cap split_compute_program_prebuilds_and_caches_chain_pieces terminate_manual_completion_port_with_delayed_async_does_not_deadlock --test-threads=1 --nocapture): 4 passed, 0 failed, 0 ignored, 0 SKIPPED (0.68 s).
  • cargo test --workspace -j 8 --no-fail-fast -- --test-threads=8 --nocapture: 1,411 executed passed, 25 SKIPPED (1,436 reported ok by cargo: 1,310 in xcl --lib, 126 across 35 integration test targets), 0 failed, 47 ignored.
    • 28 SKIPPED lines across 25 test functions:
      • no wave64 (21 lines across 14 tests): dispatch_chain_native_wave64_builds_whole, a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu, f16_programs_on_the_gpu (2 wave64 cases), f32_programs_on_the_gpu (6 wave64 cases), f64_programs_on_the_gpu, integer_programs_on_the_gpu (2 wave64 cases), mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
      • per-lane #1426 refusals (3 lines inside f16_programs_on_the_gpu and f32_programs_on_the_gpu wave32 cases): V_MUL_F16, V_PK_MUL_F16: VOP3 modifiers, V_CVT_F16_F32
      • no heap windows (1): heap_window_out_of_memory_falls_back_to_the_switch_form
      • missing D3D12 debug layer (3): the title under the debug layer (dred: false), the title under the debug layer (dred: true), uploads_start_from_each_subresources_state
  • Code check: verified that Compiled.dxil, TwoPass.cs, dispatch_chain::Chain.whole_code, and two_pass_ps / ps_dxil propagate Arc<Vec<u8>> without cloning the underlying byte vector on ShaderCache RAM hits or dispatch_chain::build, while ShaderEntry::bytes() and ShaderCache::insert() continue to account for shader.dxil.capacity() via Deref.

Regression run

Paired 60 s scripts/smoke.ps1 runs on a retail title (release build, warm cache):

main (b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3090
title: c1cc91a4
seconds: 60
exit: 0x0
frames shown: 1584 (PresentX 1584)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14015 MB

PR head (a173e209151ff299a6a368df2b4e6c6c96f2ae3e):

xcl-smoke v1
commit: a173e209151ff299a6a368df2b4e6c6c96f2ae3e
gpu: NVIDIA GeForce RTX 3090
title: c1cc91a4
seconds: 60
exit: 0x0
frames shown: 1594 (PresentX 1594)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13995 MB

(An initial cold/warming 60 s run on a173e209151ff299a6a368df2b4e6c6c96f2ae3e also exited 0x0 with 1078 (PresentX 1078) frames shown, 60 60 60 presents per 2 s, 0 device removals, 0 crashes, and 14912 MB peak commit.)

Not tested

  • Native wave64 GPUs (AMD / Intel), D3D12 debug-layer tests (d3d12SDKLayers.dll absent), XCL_HEAP_WINDOWS=1 OOM fallback, optional XCL_SAMPLE_* tests, and isolated allocation microbenchmarks.

AI use

  • Antigravity (agy) with gemini-4-argon-high (audited by gemini-4-argon-medium) reviewed the diff, ran the workspace build, SM 6.6 test suite, and paired 60 s scripts/smoke.ps1 runs, and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7191266786 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#issuecomment-7191266786). Originally posted by [MatyEjsr](https://github.com/MatyEjsr) on 2026-11-26T11:52:06Z. --- Independent SM 6.6 NVIDIA verification and paired 60 s regression run for PR #2767 at head `a173e209151ff299a6a368df2b4e6c6c96f2ae3e` (base `main` `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`), covering the SM 6.6 tests and presenting title run that could not run on the author's GTX 1050. **Tested** - Environment: Windows 11 Pro for Workstations 10.0.26200 (Developer Mode enabled), AMD Ryzen 7 7800X3D (8C/16T), 31.4 GB RAM, NVIDIA GeForce RTX 3090 (24 GiB VRAM, driver 617.42 / 32.0.16.1742, SM 6.6, wave32), `rustc 1.100.0 (0ef1bc386 2026-11-09)` (`x86_64-pc-windows-msvc`), DXC `1.9.2602.17` (`dxcompiler.dll` / `dxil.dll`), debug and release profiles. `XCL_SAMPLE_*` unset. - `cargo build --workspace -j 8` (debug) and `cargo build --release --workspace -j 8` (release): both succeeded with 0 errors. - `cargo test -p xcl --lib shader_cache_tests -- --test-threads=1 --nocapture`: **24 passed, 0 failed, 0 ignored, 0 SKIPPED** (0.32 s), including `a_ram_hit_clone_shares_the_translated_bytes` and `shader_cache_skips_repeated_translation_and_disk_lookups`. - Targeted rerun of the 4 tests that failed on the author's GTX 1050 (`cargo test --workspace -j 8 -- gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark stale_blob_cannot_bypass_the_offline_pipeline_cap split_compute_program_prebuilds_and_caches_chain_pieces terminate_manual_completion_port_with_delayed_async_does_not_deadlock --test-threads=1 --nocapture`): **4 passed, 0 failed, 0 ignored, 0 SKIPPED** (0.68 s). - `cargo test --workspace -j 8 --no-fail-fast -- --test-threads=8 --nocapture`: **1,411 executed passed, 25 SKIPPED** (1,436 reported `ok` by cargo: 1,310 in `xcl --lib`, 126 across 35 integration test targets), **0 failed, 47 ignored**. - 28 `SKIPPED` lines across 25 test functions: - `no wave64` (21 lines across 14 tests): `dispatch_chain_native_wave64_builds_whole`, `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu`, `f16_programs_on_the_gpu` (2 wave64 cases), `f32_programs_on_the_gpu` (6 wave64 cases), `f64_programs_on_the_gpu`, `integer_programs_on_the_gpu` (2 wave64 cases), `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` - per-lane `#1426` refusals (3 lines inside `f16_programs_on_the_gpu` and `f32_programs_on_the_gpu` wave32 cases): `V_MUL_F16`, `V_PK_MUL_F16: VOP3 modifiers`, `V_CVT_F16_F32` - `no heap windows` (1): `heap_window_out_of_memory_falls_back_to_the_switch_form` - missing D3D12 debug layer (3): `the title under the debug layer (dred: false)`, `the title under the debug layer (dred: true)`, `uploads_start_from_each_subresources_state` - Code check: verified that `Compiled.dxil`, `TwoPass.cs`, `dispatch_chain::Chain.whole_code`, and `two_pass_ps` / `ps_dxil` propagate `Arc<Vec<u8>>` without cloning the underlying byte vector on `ShaderCache` RAM hits or `dispatch_chain::build`, while `ShaderEntry::bytes()` and `ShaderCache::insert()` continue to account for `shader.dxil.capacity()` via `Deref`. **Regression run** Paired 60 s `scripts/smoke.ps1` runs on a retail title (release build, warm cache): main (`b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`): ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 3090 title: c1cc91a4 seconds: 60 exit: 0x0 frames shown: 1584 (PresentX 1584) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14015 MB ``` PR head (`a173e209151ff299a6a368df2b4e6c6c96f2ae3e`): ``` xcl-smoke v1 commit: a173e209151ff299a6a368df2b4e6c6c96f2ae3e gpu: NVIDIA GeForce RTX 3090 title: c1cc91a4 seconds: 60 exit: 0x0 frames shown: 1594 (PresentX 1594) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13995 MB ``` (An initial cold/warming 60 s run on `a173e209151ff299a6a368df2b4e6c6c96f2ae3e` also exited `0x0` with `1078 (PresentX 1078)` frames shown, `60 60 60` presents per 2 s, `0` device removals, `0` crashes, and `14912 MB` peak commit.) **Not tested** - Native wave64 GPUs (AMD / Intel), D3D12 debug-layer tests (`d3d12SDKLayers.dll` absent), `XCL_HEAP_WINDOWS=1` OOM fallback, optional `XCL_SAMPLE_*` tests, and isolated allocation microbenchmarks. **AI use** - Antigravity (agy) with gemini-4-argon-high (audited by gemini-4-argon-medium) reviewed the diff, ran the workspace build, SM 6.6 test suite, and paired 60 s `scripts/smoke.ps1` runs, and drafted this report.
KOLESNiii commented 2026-11-26 12:07:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T11:42:29Z.

Code review location: crates/xcl/src/gpu/recomp/pso.rs; line 1790

@@ -1783,12 +1784,31 @@ mod shader_cache_tests {
         }
         assert_eq!(calls, 1);
         let mut owned = first.as_ref().clone();
-        owned.dxil[67] = 99;
         owned.samplers.clear();
+        // the clone shares the translated bytes instead of copying them: callers only read
+        assert!(Arc::ptr_eq(&first.dxil, &owned.dxil));
         assert_eq!(first.dxil[67], 7);

With owned.dxil[67] = 99 gone, nothing writes to the bytes any more, so this assertion can't fail: first.dxil and owned.dxil are the same allocation (the ptr_eq just above shows it). The test used to check that changing a clone of a cached entry leaves the cache alone. It no longer does.

Either drop the assertion, or keep the isolation check on the copy-on-write path:

let mut owned = first.as_ref().clone();
assert!(Arc::ptr_eq(&first.dxil, &owned.dxil));
Arc::make_mut(&mut owned.dxil)[67] = 99;
owned.samplers.clear();
assert!(!Arc::ptr_eq(&first.dxil, &owned.dxil));
assert_eq!(first.dxil[67], 7);
assert_eq!(first.samplers.len(), 1);
<!-- greyfinch-sync:ivall/xcl:review-comment:4707868801 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#discussion_r4707868801). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-26T11:42:29Z. **Code review location:** `crates/xcl/src/gpu/recomp/pso.rs`; line 1790 ~~~~diff @@ -1783,12 +1784,31 @@ mod shader_cache_tests { } assert_eq!(calls, 1); let mut owned = first.as_ref().clone(); - owned.dxil[67] = 99; owned.samplers.clear(); + // the clone shares the translated bytes instead of copying them: callers only read + assert!(Arc::ptr_eq(&first.dxil, &owned.dxil)); assert_eq!(first.dxil[67], 7); ~~~~ --- With `owned.dxil[67] = 99` gone, nothing writes to the bytes any more, so this assertion can't fail: `first.dxil` and `owned.dxil` are the same allocation (the `ptr_eq` just above shows it). The test used to check that changing a clone of a cached entry leaves the cache alone. It no longer does. Either drop the assertion, or keep the isolation check on the copy-on-write path: ```rust let mut owned = first.as_ref().clone(); assert!(Arc::ptr_eq(&first.dxil, &owned.dxil)); Arc::make_mut(&mut owned.dxil)[67] = 99; owned.samplers.clear(); assert!(!Arc::ptr_eq(&first.dxil, &owned.dxil)); assert_eq!(first.dxil[67], 7); assert_eq!(first.samplers.len(), 1); ```
KOLESNiii commented 2026-11-26 12:07:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T11:42:30Z.

Code review location: crates/xcl/src/gpu/recomp/pso.rs; line 1798

@@ -1783,12 +1784,31 @@ mod shader_cache_tests {
         }
         assert_eq!(calls, 1);
         let mut owned = first.as_ref().clone();
-        owned.dxil[67] = 99;
         owned.samplers.clear();
+        // the clone shares the translated bytes instead of copying them: callers only read
+        assert!(Arc::ptr_eq(&first.dxil, &owned.dxil));
         assert_eq!(first.dxil[67], 7);
         assert_eq!(first.samplers.len(), 1);
     }
 
+    /// The clone `console_to_dxil_in` hands a caller on a RAM hit carries the cached entry's
+    /// own bytes: repeated pipeline builds of one shader do not allocate and copy its whole
+    /// DXIL again (#2609). `as_ptr` compares the byte storage, not the `Arc`s.
+    #[test]
+    fn a_ram_hit_clone_shares_the_translated_bytes() {

The doc comment is about "the clone console_to_dxil_in hands a caller", but the test never calls console_to_dxil_in. It calls cached_shader and then does .as_ref().clone() itself, copying line 172. If console_to_dxil_in goes back to a full copy (e.g. Arc::new((*shader.dxil).clone())), this test still passes and #2609 comes back.

Could the test go through console_to_dxil_in, or could the RAM-hit step move into a small helper that both console_to_dxil_in and the test call?

<!-- greyfinch-sync:ivall/xcl:review-comment:4707868820 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#discussion_r4707868820). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-26T11:42:30Z. **Code review location:** `crates/xcl/src/gpu/recomp/pso.rs`; line 1798 ~~~~diff @@ -1783,12 +1784,31 @@ mod shader_cache_tests { } assert_eq!(calls, 1); let mut owned = first.as_ref().clone(); - owned.dxil[67] = 99; owned.samplers.clear(); + // the clone shares the translated bytes instead of copying them: callers only read + assert!(Arc::ptr_eq(&first.dxil, &owned.dxil)); assert_eq!(first.dxil[67], 7); assert_eq!(first.samplers.len(), 1); } + /// The clone `console_to_dxil_in` hands a caller on a RAM hit carries the cached entry's + /// own bytes: repeated pipeline builds of one shader do not allocate and copy its whole + /// DXIL again (#2609). `as_ptr` compares the byte storage, not the `Arc`s. + #[test] + fn a_ram_hit_clone_shares_the_translated_bytes() { ~~~~ --- The doc comment is about "the clone `console_to_dxil_in` hands a caller", but the test never calls `console_to_dxil_in`. It calls `cached_shader` and then does `.as_ref().clone()` itself, copying line 172. If `console_to_dxil_in` goes back to a full copy (e.g. `Arc::new((*shader.dxil).clone())`), this test still passes and #2609 comes back. Could the test go through `console_to_dxil_in`, or could the RAM-hit step move into a small helper that both `console_to_dxil_in` and the test call?
ettehn commented 2026-11-26 13:05:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-26T12:23:15Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:ivall/xcl:review:6074059188 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#pullrequestreview-6074059188). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-26T12:23:15Z. **Review:** COMMENTED --- _No description provided._
SzczepanGrela commented 2026-11-26 13:05:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-26T12:50:15Z.


Additional RX 9070 / Wine verification, including the native-wave64 case skipped in the RTX 3090 report.

Tested

  • Exact head a173e209151ff299a6a368df2b4e6c6c96f2ae3e, against main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 with only a_ram_hit_clone_shares_the_translated_bytes added inside shader_cache_tests. Main production code was unchanged; no local source changes on the head.
  • RX 9070 16 GB (RADV GFX1201), Ryzen 7 7700, CachyOS kernel 7.3.0-5-cachyos, Mesa 26.3.1-arch3.5, GE-Proton11-12 Wine 11.0 Staging, vkd3d-proton 8293130ebe370b1+ (local asserts-disabled build), DXC/DXIL 1.9.2602.17, Rust 1.97.1, release x86_64-pc-windows-gnu.
  • Explicit RX 9070 selection, XCL_REQUIRE_GPU=wave64, XCL_NETWORK=0, no XCL_SAMPLE_*. Windows libtest binaries invoked directly through GE-Proton Wine with --nocapture, --exact for individual cases, and a fresh process per invocation.
  • New RAM-hit storage-identity test: head passes 3/3 fresh processes; main control fails 3/3 with the RAM hit copied the whole DXIL.
  • Filter gpu::recomp::pso::shader_cache_tests::, both --test-threads=1 and 4: head 24 passed / 0 failed / 0 ignored. Main plus the new negative-control test: 23 passed / 1 failed / 0 ignored, with only that storage-identity assertion failing.
  • gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole: 1/0/0 on each revision, executing the GPU comparison rather than skipping.
  • shaders::pipeline_cap_tests::stale_blob_cannot_bypass_the_offline_pipeline_cap: 1/0/0 on each revision, including gpu_word0=42.
  • shaders_e2e synthetic CLI/translation suite: 8/0/0 per revision at both 1 and 4 threads. These are CLI/compilation checks, not full graphics-runtime coverage.

Driver-cache control for split_compute_program_prebuilds_and_caches_chain_pieces:

  • With a fresh private VKD3D_SHADER_CACHE_PATH directory: 3/3 passes per revision, including the cached-piece checks.
  • With VKD3D_SHADER_CACHE_PATH=0: 3/3 failures per revision at pipelines.reused == 2 (actual 0). This result differs with the cache setting on both sides.

No skip markers or ignored tests in these runs. Raw summaries, repeated control failures, source inventories and executable hashes were checked after testing.

Not tested

Native Windows, other GPUs, full workspace suite, retail/smoke workloads, full graphics-runtime behavior, peak-memory savings, or performance. No FPS or memory-reduction claim from these synthetic checks.

AI use

OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, ran and checked the paired tests and cache-setting controls, and drafted this report. Publication authorized by the account owner.

<!-- greyfinch-sync:ivall/xcl:comment:7192525460 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#issuecomment-7192525460). Originally posted by [SzczepanGrela](https://github.com/SzczepanGrela) on 2026-11-26T12:50:15Z. --- Additional RX 9070 / Wine verification, including the native-wave64 case skipped in the RTX 3090 report. **Tested** - Exact head `a173e209151ff299a6a368df2b4e6c6c96f2ae3e`, against main `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7` with only `a_ram_hit_clone_shares_the_translated_bytes` added inside `shader_cache_tests`. Main production code was unchanged; no local source changes on the head. - RX 9070 16 GB (RADV GFX1201), Ryzen 7 7700, CachyOS kernel 7.3.0-5-cachyos, Mesa 26.3.1-arch3.5, GE-Proton11-12 Wine 11.0 Staging, vkd3d-proton `8293130ebe370b1+` (local asserts-disabled build), DXC/DXIL 1.9.2602.17, Rust 1.97.1, release `x86_64-pc-windows-gnu`. - Explicit RX 9070 selection, `XCL_REQUIRE_GPU=wave64`, `XCL_NETWORK=0`, no `XCL_SAMPLE_*`. Windows libtest binaries invoked directly through GE-Proton Wine with `--nocapture`, `--exact` for individual cases, and a fresh process per invocation. - New RAM-hit storage-identity test: head passes 3/3 fresh processes; main control fails 3/3 with `the RAM hit copied the whole DXIL`. - Filter `gpu::recomp::pso::shader_cache_tests::`, both `--test-threads=1` and `4`: head 24 passed / 0 failed / 0 ignored. Main plus the new negative-control test: 23 passed / 1 failed / 0 ignored, with only that storage-identity assertion failing. - `gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole`: 1/0/0 on each revision, executing the GPU comparison rather than skipping. - `shaders::pipeline_cap_tests::stale_blob_cannot_bypass_the_offline_pipeline_cap`: 1/0/0 on each revision, including `gpu_word0=42`. - `shaders_e2e` synthetic CLI/translation suite: 8/0/0 per revision at both 1 and 4 threads. These are CLI/compilation checks, not full graphics-runtime coverage. Driver-cache control for `split_compute_program_prebuilds_and_caches_chain_pieces`: - With a fresh private `VKD3D_SHADER_CACHE_PATH` directory: 3/3 passes per revision, including the cached-piece checks. - With `VKD3D_SHADER_CACHE_PATH=0`: 3/3 failures per revision at `pipelines.reused == 2` (actual 0). This result differs with the cache setting on both sides. No skip markers or ignored tests in these runs. Raw summaries, repeated control failures, source inventories and executable hashes were checked after testing. **Not tested** Native Windows, other GPUs, full workspace suite, retail/smoke workloads, full graphics-runtime behavior, peak-memory savings, or performance. No FPS or memory-reduction claim from these synthetic checks. **AI use** OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, ran and checked the paired tests and cache-setting controls, and drafted this report. Publication authorized by the account owner.
ettehn commented 2026-11-26 13:05:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-26T12:23:14Z.

Code review location: crates/xcl/src/gpu/recomp/pso.rs; line 1798

@@ -1783,12 +1784,31 @@ mod shader_cache_tests {
         }
         assert_eq!(calls, 1);
         let mut owned = first.as_ref().clone();
-        owned.dxil[67] = 99;
         owned.samplers.clear();
+        // the clone shares the translated bytes instead of copying them: callers only read
+        assert!(Arc::ptr_eq(&first.dxil, &owned.dxil));
         assert_eq!(first.dxil[67], 7);
         assert_eq!(first.samplers.len(), 1);
     }
 
+    /// The clone `console_to_dxil_in` hands a caller on a RAM hit carries the cached entry's
+    /// own bytes: repeated pipeline builds of one shader do not allocate and copy its whole
+    /// DXIL again (#2609). `as_ptr` compares the byte storage, not the `Arc`s.
+    #[test]
+    fn a_ram_hit_clone_shares_the_translated_bytes() {

I tried the direct-entry test on Windows 11 (Rust 1.97.1 MSVC, DXC 1.8.2502.11), using the identical test on a173e209 and main b49be183. The byte comparison passed on both, and the pointer comparison passed on the PR head and failed on main. No GPU dispatch or retail title is needed.

This worked inside shader_cache_tests:

#[test]
fn public_translation_entry_shares_ram_hit_storage() {
    use crate::gpu::xbox::tests::{fssm, sample, CODE};
    let mut payload = fssm(&CODE, &[(6, 0)]);
    for offset in [0x13C, 0x140, 0x144] {
        payload[offset..offset + 4].copy_from_slice(&1u32.to_le_bytes());
    }
    let blob = sample(5, &[payload]);
    let first = console_to_dxil_in(&blob, Stage::Compute, 0, true, 4).unwrap();
    let second = console_to_dxil_in(&blob, Stage::Compute, 0, true, 4).unwrap();
    assert_eq!(&first.dxil[..], &second.dxil[..]);
    assert!(std::ptr::eq(first.dxil.as_ptr(), second.dxil.as_ptr()),
        "the public translation entry copied bytes on a RAM hit");
}

Ran cargo test --locked -p xcl --lib public_translation_entry_shares_ram_hit_storage -- --test-threads=1 with a separate XCL_DXIL_CACHE for each build. For a permanent test, the repo's usual DXC availability guard would let it skip cleanly on machines without DXC.

AI-assisted test and verification (OpenAI Codex).

<!-- greyfinch-sync:ivall/xcl:review-comment:4708290457 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#discussion_r4708290457). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-26T12:23:14Z. **Code review location:** `crates/xcl/src/gpu/recomp/pso.rs`; line 1798 ~~~~diff @@ -1783,12 +1784,31 @@ mod shader_cache_tests { } assert_eq!(calls, 1); let mut owned = first.as_ref().clone(); - owned.dxil[67] = 99; owned.samplers.clear(); + // the clone shares the translated bytes instead of copying them: callers only read + assert!(Arc::ptr_eq(&first.dxil, &owned.dxil)); assert_eq!(first.dxil[67], 7); assert_eq!(first.samplers.len(), 1); } + /// The clone `console_to_dxil_in` hands a caller on a RAM hit carries the cached entry's + /// own bytes: repeated pipeline builds of one shader do not allocate and copy its whole + /// DXIL again (#2609). `as_ptr` compares the byte storage, not the `Arc`s. + #[test] + fn a_ram_hit_clone_shares_the_translated_bytes() { ~~~~ --- I tried the direct-entry test on Windows 11 (Rust 1.97.1 MSVC, DXC 1.8.2502.11), using the identical test on `a173e209` and `main` `b49be183`. The byte comparison passed on both, and the pointer comparison passed on the PR head and failed on main. No GPU dispatch or retail title is needed. This worked inside `shader_cache_tests`: ```rust #[test] fn public_translation_entry_shares_ram_hit_storage() { use crate::gpu::xbox::tests::{fssm, sample, CODE}; let mut payload = fssm(&CODE, &[(6, 0)]); for offset in [0x13C, 0x140, 0x144] { payload[offset..offset + 4].copy_from_slice(&1u32.to_le_bytes()); } let blob = sample(5, &[payload]); let first = console_to_dxil_in(&blob, Stage::Compute, 0, true, 4).unwrap(); let second = console_to_dxil_in(&blob, Stage::Compute, 0, true, 4).unwrap(); assert_eq!(&first.dxil[..], &second.dxil[..]); assert!(std::ptr::eq(first.dxil.as_ptr(), second.dxil.as_ptr()), "the public translation entry copied bytes on a RAM hit"); } ``` Ran `cargo test --locked -p xcl --lib public_translation_entry_shares_ram_hit_storage -- --test-threads=1` with a separate `XCL_DXIL_CACHE` for each build. For a permanent test, the repo's usual DXC availability guard would let it skip cleanly on machines without DXC. AI-assisted test and verification (OpenAI Codex).
Prime1997 commented 2026-11-26 13:06:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T13:06:08Z.

Review: COMMENTED


Good within the reviewed scope; retain for integration. Sharing the cached DXIL through Arc is worth keeping. It avoids cloning the same byte storage for repeated cache retrievals while retaining the existing cache ownership.

PR head a173e209151ff299a6a368df2b4e6c6c96f2ae3e integrated locally with current main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. The detached worktree remains at main with the combined changes staged, tree 21881fc47d87b88aa3ba04a4fa92f7e776e789f4; it is an uncommitted integration candidate, not a clean PR-head run. Source patch SHA-256 63a600b1dbc32d3f8d59ea961cb317141289d9af89e702850105dcd3e0c621b8.

Targeted result: 2 passed, 0 failed, 0 ignored, 0 skipped. Each exact filter ran in a fresh process:

  • gpu::recomp::pso::shader_cache_tests::a_ram_hit_clone_shares_the_translated_bytes
  • gpu::recomp::pso::shader_cache_tests::shader_cache_skips_repeated_translation_and_disk_lookups

Build: cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run: <test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work.

Not tested: The two focused tests check shared storage and repeated cache lookups. They do not cover eviction, every public translation entry point or peak memory in a title. No whole suite or retail smoke was run for this batch; this is not merge certification.

AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.

<!-- greyfinch-sync:ivall/xcl:review:6074634217 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#pullrequestreview-6074634217). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-26T13:06:08Z. **Review:** COMMENTED --- **Good within the reviewed scope; retain for integration.** Sharing the cached DXIL through Arc is worth keeping. It avoids cloning the same byte storage for repeated cache retrievals while retaining the existing cache ownership. PR head `a173e209151ff299a6a368df2b4e6c6c96f2ae3e` integrated locally with current main `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. The detached worktree remains at main with the combined changes staged, tree `21881fc47d87b88aa3ba04a4fa92f7e776e789f4`; it is an uncommitted integration candidate, not a clean PR-head run. Source patch SHA-256 `63a600b1dbc32d3f8d59ea961cb317141289d9af89e702850105dcd3e0c621b8`. **Targeted result: 2 passed, 0 failed, 0 ignored, 0 skipped.** Each exact filter ran in a fresh process: - `gpu::recomp::pso::shader_cache_tests::a_ram_hit_clone_shares_the_translated_bytes` - `gpu::recomp::pso::shader_cache_tests::shader_cache_skips_repeated_translation_and_disk_lookups` Build: `cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>`. Run: `<test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture`. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work. **Not tested:** The two focused tests check shared storage and repeated cache lookups. They do not cover eviction, every public translation entry point or peak memory in a title. No whole suite or retail smoke was run for this batch; this is not merge certification. AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing and comparing results.
Decodere commented 2026-11-26 23:10:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T23:10:53Z.


Independent desktop NVIDIA verification of PR #2767 at head a173e209151ff299a6a368df2b4e6c6c96f2ae3e (1 commit; exact parent & merge-base: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (a173e209)

Command Result
cargo test --release -p xcl --lib a_ram_hit_clone_shares_the_translated_bytes -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1336 filtered out × 3 (0.00s, 0.00s, 0.00s)
cargo test --release -p xcl --lib gpu::recomp::pso:: 28 passed; 0 failed; 1 ignored; 1308 filtered out (0.08s; repeated_pso_shader_compile is #[ignore])
cargo test --release -p xcl --lib hle::d3d12x::real:: 60 passed; 0 failed; 0 ignored; 1277 filtered out (0.39s)
cargo test --release -p xcl --lib shaders:: 10 passed; 0 failed; 0 ignored; 1327 filtered out (0.20s; 1 test self-skipped at runtime, see below)
cargo build --release -p xcl --bin xcl Clean build (1m 12s, exit 0)

Note on shaders::: shaders::tests::pso_measurement_compiles_an_exact_synthetic_record printed SKIPPED at runtime (0x887A002D) because Windows Developer Mode is disabled on this host (required by D3D12 to disable the driver shader cache); the remaining 9 tests executed and passed.

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, cached baseline on the same machine):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB

PR #2767 (a173e209151ff299a6a368df2b4e6c6c96f2ae3e):

xcl-smoke v1
commit: a173e209151ff299a6a368df2b4e6c6c96f2ae3e
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14002 MB

Runtime log observations (xcl.log)

  • 9222 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19552 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14002 MB committed by the process; video memory 6114 MB local, 4682 MB non-local.

Limits of coverage

  • Arc-backed DXIL buffer sharing on RAM cache hits (a_ram_hit_clone_shares_the_translated_bytes, 3/3) and integration with gpu::recomp::pso::, hle::d3d12x::real::, and shaders:: passed cleanly (repeated_pso_shader_compile remained #[ignore]; pso_measurement_compiles_an_exact_synthetic_record self-skipped because Windows Developer Mode is off).
  • No separate allocation-profiler benchmark measuring total RAM-copy savings during cold multi-PSO bursts was run; the 60 s warm-cache retail smoke confirms clean end-to-end stability and zero regression on title: 29640639 (frame-count delta vs. cached parent smoke reflects single-run startup variance, not this PR).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7205322739 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#issuecomment-7205322739). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T23:10:53Z. --- Independent desktop NVIDIA verification of **PR #2767** at head `a173e209151ff299a6a368df2b4e6c6c96f2ae3e` (`1` commit; exact parent & merge-base: `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`a173e209`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib a_ram_hit_clone_shares_the_translated_bytes -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1336 filtered out` × 3 (`0.00s`, `0.00s`, `0.00s`) | | `cargo test --release -p xcl --lib gpu::recomp::pso::` | `28 passed; 0 failed; 1 ignored; 1308 filtered out` (`0.08s`; `repeated_pso_shader_compile` is `#[ignore]`) | | `cargo test --release -p xcl --lib hle::d3d12x::real::` | `60 passed; 0 failed; 0 ignored; 1277 filtered out` (`0.39s`) | | `cargo test --release -p xcl --lib shaders::` | `10 passed; 0 failed; 0 ignored; 1327 filtered out` (`0.20s`; `1` test self-skipped at runtime, see below) | | `cargo build --release -p xcl --bin xcl` | Clean build (`1m 12s`, exit `0`) | Note on `shaders::`: `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` printed `SKIPPED` at runtime (`0x887A002D`) because Windows Developer Mode is disabled on this host (required by D3D12 to disable the driver shader cache); the remaining `9` tests executed and passed. ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`, cached baseline on the same machine): ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1518 (PresentX 1518) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14018 MB ``` PR #2767 (`a173e209151ff299a6a368df2b4e6c6c96f2ae3e`): ``` xcl-smoke v1 commit: a173e209151ff299a6a368df2b4e6c6c96f2ae3e gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14002 MB ``` ### Runtime log observations (`xcl.log`) - `9222` log lines, `0` `[ERROR]` / device-removal / panic lines. - Final draw/memory telemetry in log: `19552 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `14002 MB committed by the process; video memory 6114 MB local, 4682 MB non-local`. ### Limits of coverage - `Arc`-backed DXIL buffer sharing on RAM cache hits (`a_ram_hit_clone_shares_the_translated_bytes`, 3/3) and integration with `gpu::recomp::pso::`, `hle::d3d12x::real::`, and `shaders::` passed cleanly (`repeated_pso_shader_compile` remained `#[ignore]`; `pso_measurement_compiles_an_exact_synthetic_record` self-skipped because Windows Developer Mode is off). - No separate allocation-profiler benchmark measuring total RAM-copy savings during cold multi-PSO bursts was run; the 60 s warm-cache retail smoke confirms clean end-to-end stability and zero regression on `title: 29640639` (frame-count delta vs. cached parent smoke reflects single-run startup variance, not this PR). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
JJAutoCompare commented 2026-11-27 00:21:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:21:57Z.


Tested: a173e209151ff299a6a368df2b4e6c6c96f2ae3e on Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC, debug, DXC 1.9.2602.17. Ran shader_cache_evicts_old_entries_and_skips_oversized_shaders and two synthetic verify_pr2767_ probes with --test-threads=1 --nocapture. Three passed, no failures, ignores or skips. The checked-in fixture covers eviction and entry limits. The temporary test-only probes found that a 68-byte DXIL vector reserved at 4,096 bytes exceeded a 4,096-byte budget once the one-byte source was counted. The caller kept the original pointer and bytes after eviction. Two calls through console_mesh also shared the 2,316-byte compute-pass buffer, while the 4,184-byte passthrough bytes matched at distinct addresses.

Not tested: GPU execution, driver PSO creation, deferred chain ownership, full suite and retail smoke.

AI use: T3 Code / Codex (gpt-6.2-sol) ran and reran the checks and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7206399215 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#issuecomment-7206399215). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-27T00:21:57Z. --- **Tested:** `a173e209151ff299a6a368df2b4e6c6c96f2ae3e` on Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC, debug, DXC 1.9.2602.17. Ran `shader_cache_evicts_old_entries_and_skips_oversized_shaders` and two synthetic `verify_pr2767_` probes with `--test-threads=1 --nocapture`. Three passed, no failures, ignores or skips. The checked-in fixture covers eviction and entry limits. The temporary test-only probes found that a 68-byte DXIL vector reserved at 4,096 bytes exceeded a 4,096-byte budget once the one-byte source was counted. The caller kept the original pointer and bytes after eviction. Two calls through `console_mesh` also shared the 2,316-byte compute-pass buffer, while the 4,184-byte passthrough bytes matched at distinct addresses. **Not tested:** GPU execution, driver PSO creation, deferred chain ownership, full suite and retail smoke. **AI use:** T3 Code / Codex (`gpt-6.2-sol`) ran and reran the checks and wrote this report.
Foniass commented 2026-12-01 08:54:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:54:57Z.


Triage (#1607) – head a173e20

#2085 (closed as a duplicate of this one) also shared the translated DXIL between pipeline builds. Here Compiled::dxil and TwoPass::cs become Arc<Vec<u8>>, and dispatch_chain::build takes the Arc instead of copying whole. main still has dxil: Vec<u8> and has since added a dispatch_remap field to Compiled, so the branch conflicts and needs a rebase. The new test a_ram_hit_clone_shares_the_translated_bytes checks pointer identity on a RAM hit. The one removed test line (mutating owned.dxil[67]) is no longer possible with an Arc and is replaced by a ptr_eq check. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305954198 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2767#issuecomment-7305954198). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:54:57Z. --- **Triage (#1607)** – head a173e20 #2085 (closed as a duplicate of this one) also shared the translated DXIL between pipeline builds. Here `Compiled::dxil` and `TwoPass::cs` become `Arc<Vec<u8>>`, and `dispatch_chain::build` takes the Arc instead of copying `whole`. main still has `dxil: Vec<u8>` and has since added a `dispatch_remap` field to `Compiled`, so the branch conflicts and needs a rebase. The new test `a_ram_hit_clone_shares_the_translated_bytes` checks pointer identity on a RAM hit. The one removed test line (mutating `owned.dxil[67]`) is no longer possible with an Arc and is replaced by a `ptr_eq` check. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/2767:upstream-pr/2767'
git switch 'upstream-pr/2767'

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/2767'
git switch 'upstream-pr/2767'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2767'
git switch 'upstream-pr/2767'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2767'
git switch 'main'
git merge --squash 'upstream-pr/2767'
git switch 'main'
git merge --ff-only 'upstream-pr/2767'
git switch 'main'
git merge 'upstream-pr/2767'
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!2757
No description provided.