Shaders: cache legacy ES+GS compute pass translation in RAM #2918

Open
github-bot wants to merge 1 commit from github-bot/gh-2918 into main AGit
Owner

@⁠real-alponzo on GitHub · 2026-11-26 23:13 UTC · original
real-alponzo:fix/2876-cache-geometry-compute-pass → main · +105 −19 · 1 files · 1 commits · open

Cache the compiled ES+GS compute pass (Compiled, MsInterface) in console_geometry across legacy geometry pipelines that differ only in pixel shader or fixed-function state, matching console_mesh.

Fixes #2876.

What is in it

  • Added an in-memory GeometryCache (cached_geometry_compute_in, capped at 256 entries, never caching errors or dxc::defer() misses) in crates/xcl/src/gpu/recomp/pso.rs, keyed by (vs hash, vs len, gs hash, gs len, mem_windows, split_wave64, direct_dxil).
  • Split compile_console_geometry out of console_geometry (respecting dxc::defer() on the direct DXIL path and cache_allowed(Stage::Mesh, ...)), reusing finish_two_pass_compiled for the pixel-signature-specific mesh passthrough and removing the now-unused finish_two_pass helper.
  • Added unit test shader_cache_tests::geometry_compute_cache_reuses_es_gs_and_skips_errors.

Regression run

Base (main):

xcl-smoke v1
commit: 8b957bec6f82495aec940944c6bf47faa02db590
gpu: AMD Radeon RX 6800
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1525 (PresentX 1525)
presents per 2 s (last 3): 60 61 59
device removals: 0
crashes: 0
peak commit: 14867 MB

PR head (4ddb971c):

xcl-smoke v1
commit: 4ddb971c748d0387cc7aed3da05e259cad255d78
gpu: AMD Radeon RX 6800
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1549 (PresentX 1549)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14863 MB

Tested

  • Hardware: Windows 11 Pro for Workstations x64 (Build 26300), Intel Core i9-9900K, 32 GB RAM, AMD Radeon RX 6800 (Driver 32.0.21045.29003), rustc 1.100.0, DXC 1.9.2602.17.
  • cargo test -p xcl --lib geometry_compute_cache_reuses_es_gs_and_skips_errors -- --nocapture: 1 passed; 0 failed; 0 ignored; 1345 filtered out.
  • .\scripts\smoke.ps1 -Game "C:\VIctory-SSD-test\game" -Seconds 60 on 8b957bec and 4ddb971c (blocks above).

Not tested

  • Full cargo test --workspace locally on this exact branch (targeted unit test and paired 60 s retail smoke verified; CI runs the full suite).
  • Extended world-load measurement of legacy ES+GS PSO rebuild counts beyond the 60 s smoke run.

AI use

  • Antigravity (Gemini 4 Neon) implemented the console_geometry compute-pass RAM cache, wrote the unit test, ran the test and paired smoke runs, and drafted this PR description.
**@⁠real-alponzo** on GitHub · 2026-11-26 23:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/2918) `real-alponzo:fix/2876-cache-geometry-compute-pass` → `main` · +105 −19 · 1 files · 1 commits · open Cache the compiled ES+GS compute pass `(Compiled, MsInterface)` in `console_geometry` across legacy geometry pipelines that differ only in pixel shader or fixed-function state, matching `console_mesh`. Fixes #2876. **What is in it** - Added an in-memory `GeometryCache` (`cached_geometry_compute_in`, capped at 256 entries, never caching errors or `dxc::defer()` misses) in `crates/xcl/src/gpu/recomp/pso.rs`, keyed by `(vs hash, vs len, gs hash, gs len, mem_windows, split_wave64, direct_dxil)`. - Split `compile_console_geometry` out of `console_geometry` (respecting `dxc::defer()` on the direct DXIL path and `cache_allowed(Stage::Mesh, ...)`), reusing `finish_two_pass_compiled` for the pixel-signature-specific mesh passthrough and removing the now-unused `finish_two_pass` helper. - Added unit test `shader_cache_tests::geometry_compute_cache_reuses_es_gs_and_skips_errors`. **Regression run** Base (`main`): ``` xcl-smoke v1 commit: 8b957bec6f82495aec940944c6bf47faa02db590 gpu: AMD Radeon RX 6800 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1525 (PresentX 1525) presents per 2 s (last 3): 60 61 59 device removals: 0 crashes: 0 peak commit: 14867 MB ``` PR head (`4ddb971c`): ``` xcl-smoke v1 commit: 4ddb971c748d0387cc7aed3da05e259cad255d78 gpu: AMD Radeon RX 6800 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1549 (PresentX 1549) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14863 MB ``` **Tested** - Hardware: Windows 11 Pro for Workstations x64 (Build 26300), Intel Core i9-9900K, 32 GB RAM, AMD Radeon RX 6800 (Driver 32.0.21045.29003), `rustc 1.100.0`, DXC 1.9.2602.17. - `cargo test -p xcl --lib geometry_compute_cache_reuses_es_gs_and_skips_errors -- --nocapture`: `1 passed; 0 failed; 0 ignored; 1345 filtered out`. - `.\scripts\smoke.ps1 -Game "C:\VIctory-SSD-test\game" -Seconds 60` on `8b957bec` and `4ddb971c` (blocks above). **Not tested** - Full `cargo test --workspace` locally on this exact branch (targeted unit test and paired 60 s retail smoke verified; CI runs the full suite). - Extended world-load measurement of legacy ES+GS PSO rebuild counts beyond the 60 s smoke run. **AI use** - Antigravity (Gemini 4 Neon) implemented the `console_geometry` compute-pass RAM cache, wrote the unit test, ran the test and paired smoke runs, and drafted this PR description.
console_geometry previously reparsed and retranslated the combined ES+GS compute pass on every legacy geometry PSO build even when only the pixel shader or fixed-function state changed.

Cache the compiled (Compiled, MsInterface) compute pass in RAM keyed by (vs hash/len, gs hash/len, windows, split_wave64, direct_dxil), matching console_mesh, and reuse finish_two_pass_compiled for the pixel-signature-specific mesh passthrough.

Fixes #2876.

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:15:59 +00:00
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-26 23:27 UTC · original

Tested: Clean 4ddb971c748d0387cc7aed3da05e259cad255d78, Windows 11 25H2 26200.9974, Ryzen 7 3800X, Intel Arc A770 16 GiB (32.0.101.9175), Rust 1.100.0 MSVC, DXC/DXIL 1.9.2609.5, debug. Built with cargo test --locked --offline -p xcl --lib --no-run. Ran the resulting executable with gpu::recomp::pso::shader_cache_tests::geometry_compute_cache_reuses_es_gs_and_skips_errors --exact --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored, 0 skips. The helper test covers repeat lookup, failure retry, and a distinct key. With XCL_ADAPTER=A770, ran gpu::recomp::tests::gpu_geometry_mode_es_gs_strip --nocapture --test-threads=1: 2 passed, 0 failed, 0 ignored, 0 skips. The two geometry fixtures check ES+GS records and the mesh pass-through on device.

Not tested: The two GPU fixtures exercise the translation/draw path without measuring the runtime cache hit rate or wall-time improvement. Full suite and retail smoke were outside this run.

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

**@⁠JJAutoCompare** on GitHub · 2026-11-26 23:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2918#issuecomment-7205561146) **Tested:** Clean `4ddb971c748d0387cc7aed3da05e259cad255d78`, Windows 11 25H2 26200.9974, Ryzen 7 3800X, Intel Arc A770 16 GiB (32.0.101.9175), Rust 1.100.0 MSVC, DXC/DXIL 1.9.2609.5, debug. Built with `cargo test --locked --offline -p xcl --lib --no-run`. Ran the resulting executable with `gpu::recomp::pso::shader_cache_tests::geometry_compute_cache_reuses_es_gs_and_skips_errors --exact --nocapture --test-threads=1`: **1 passed, 0 failed, 0 ignored, 0 skips**. The helper test covers repeat lookup, failure retry, and a distinct key. With `XCL_ADAPTER=A770`, ran `gpu::recomp::tests::gpu_geometry_mode_es_gs_strip --nocapture --test-threads=1`: **2 passed, 0 failed, 0 ignored, 0 skips**. The two geometry fixtures check ES+GS records and the mesh pass-through on device. **Not tested:** The two GPU fixtures exercise the translation/draw path without measuring the runtime cache hit rate or wall-time improvement. Full suite and retail smoke were outside this run. **AI use:** T3 Code / Codex (`gpt-6.2-sol`) ran the tests and wrote this report.
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-27 00:17 UTC · original

Full suite on NVIDIA (listed under Not tested): passes. The helper test fails with the lookup disabled, but nothing in the suite calls console_geometry, so the new cache and its key are not reached by any test.

Tested: 4ddb971 (its base is current main 8b957be, so head = merged). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug, DXC 1.9.2602.17.

result
cargo test --workspace --no-fail-fast -- --test-threads=4 1447 passed, 0 failed, 47 ignored; 25 SKIPPED lines (no wave64, refused per-lane forms)
scratch eprintln! on each hit / miss in cached_geometry_compute_in, cargo test -p xcl --lib, plain and with XCL_DIRECT_DXIL=1 3 misses and 1 hit both times, which are exactly the new unit test's own calls: 0 from real pipelines; all tests pass
scratch: the get(&key) lookup replaced by None geometry_compute_cache_reuses_es_gs_and_skips_errors fails 3 of 3 (repeated ES+GS key must hit RAM cache without retranslating)

console_geometry's only caller is the translated GS pipeline path in real.rs (real.rs:6307); gpu_geometry_mode_es_gs_strip takes another route. So a key that left out a field, or a hit that returned another program's MsInterface, would pass the suite. A test that calls console_geometry twice with the same VS/GS and different PS (expecting one translation), and once with a different GS, would cover the shipped path.

Not tested: a title with legacy GS pipelines (no rebuild count was measured), AMD / Intel on this run.

AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch checks and wrote this report.

**@⁠fromthemoonx** on GitHub · 2026-11-27 00:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/2918#issuecomment-7206333938) **Full suite on NVIDIA (listed under Not tested): passes. The helper test fails with the lookup disabled, but nothing in the suite calls `console_geometry`, so the new cache and its key are not reached by any test.** **Tested:** `4ddb971` (its base is current `main` `8b957be`, so head = merged). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug, DXC 1.9.2602.17. | | result | |---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4` | 1447 passed, 0 failed, 47 ignored; 25 `SKIPPED` lines (`no wave64`, refused per-lane forms) | | scratch `eprintln!` on each hit / miss in `cached_geometry_compute_in`, `cargo test -p xcl --lib`, plain and with `XCL_DIRECT_DXIL=1` | 3 misses and 1 hit both times, which are exactly the new unit test's own calls: 0 from real pipelines; all tests pass | | scratch: the `get(&key)` lookup replaced by `None` | `geometry_compute_cache_reuses_es_gs_and_skips_errors` fails 3 of 3 (`repeated ES+GS key must hit RAM cache without retranslating`) | `console_geometry`'s only caller is the translated GS pipeline path in `real.rs` (`real.rs:6307`); `gpu_geometry_mode_es_gs_strip` takes another route. So a key that left out a field, or a hit that returned another program's `MsInterface`, would pass the suite. A test that calls `console_geometry` twice with the same VS/GS and different PS (expecting one translation), and once with a different GS, would cover the shipped path. **Not tested:** a title with legacy GS pipelines (no rebuild count was measured), AMD / Intel on this run. **AI use:** Claude Code (Claude Opus 5.5) ran the tests and the scratch checks and wrote this report.
Author
Owner

@⁠andrewDoing on GitHub · 2026-11-27 00:33 UTC · original

On head 4ddb971c748d0387cc7aed3da05e259cad255d78, four concurrently requested native graphics PSOs sharing console VS/GS bytes but using different pixel shaders entered ES+GS lowering four times. Four additional PSOs with the same VS/GS and new pixel shaders entered lowering zero times. On an RTX 5070, all eight draws produced the color expected from their own PS. Four fresh processes reproduced the 4/0 counts, including three using an already populated DXIL cache.

Reproduction. In gpu_two_pass_cache_e2e, reuse synthetic_vs_gs_containers, build_gs_pso, and draw_two_pass_and_read. Compile eight PS variants that add red-channel constants 1 through 8 to the incoming color. Release four workers simultaneously immediately before pipeline creation, wait for all four PSOs, then draw each. Repeat with the other four PS variants in the same process. Count entries to compile_console_geometry. We used direct DXIL, RTX 5070 selection, a writable shader cache and no sleeps inside the compiler.

Local fix experiment. Reuse the existing per-key in-flight mutex pattern from cached_shader, keyed by the complete GeometryKey. Recheck the map after acquiring the per-key lock and before insertion. An ordinary worker compiles outside the cache mutex. A cached-only probe bypasses the in-flight lock. Once the 256-entry map is full, uncacheable misses bypass serialization, including when the last slot filled while a caller was waiting. Leave failed results uncached.

The same four-process experiment produced 1/0 lowerings with the change, with correct readbacks for all 32 draws. The focused command cargo test --locked --offline -p xcl --lib shader_cache_tests -- --test-threads=4 --show-output passed 26/26 tests, including new same-key sharing, unrelated-key progress, nonblocking cached-only miss and full-cache parallelism cases, plus the existing failure/retry test. The native probe was cargo test --locked --offline -p xcl --test gpu_two_pass_cache_e2e local_geometry_pso_concurrency -- --test-threads=1 --nocapture with the local fixture described above.

This measures redundant lowering in a controlled workload. Retail overlap frequency, wall-time improvement and the full workspace suite on the local fix remain unmeasured. AI use: OpenAI Codex with GPT-6.2 Astra prepared and ran the probes and implemented the local experiment; Codex coordinated and prepared this report.

**@⁠andrewDoing** on GitHub · 2026-11-27 00:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2918#issuecomment-7206560253) On head `4ddb971c748d0387cc7aed3da05e259cad255d78`, four concurrently requested native graphics PSOs sharing console VS/GS bytes but using different pixel shaders entered ES+GS lowering four times. Four additional PSOs with the same VS/GS and new pixel shaders entered lowering zero times. On an RTX 5070, all eight draws produced the color expected from their own PS. Four fresh processes reproduced the 4/0 counts, including three using an already populated DXIL cache. **Reproduction.** In `gpu_two_pass_cache_e2e`, reuse `synthetic_vs_gs_containers`, `build_gs_pso`, and `draw_two_pass_and_read`. Compile eight PS variants that add red-channel constants 1 through 8 to the incoming color. Release four workers simultaneously immediately before pipeline creation, wait for all four PSOs, then draw each. Repeat with the other four PS variants in the same process. Count entries to `compile_console_geometry`. We used direct DXIL, RTX 5070 selection, a writable shader cache and no sleeps inside the compiler. **Local fix experiment.** Reuse the existing per-key in-flight mutex pattern from `cached_shader`, keyed by the complete `GeometryKey`. Recheck the map after acquiring the per-key lock and before insertion. An ordinary worker compiles outside the cache mutex. A cached-only probe bypasses the in-flight lock. Once the 256-entry map is full, uncacheable misses bypass serialization, including when the last slot filled while a caller was waiting. Leave failed results uncached. The same four-process experiment produced **1/0 lowerings** with the change, with correct readbacks for all 32 draws. The focused command `cargo test --locked --offline -p xcl --lib shader_cache_tests -- --test-threads=4 --show-output` passed 26/26 tests, including new same-key sharing, unrelated-key progress, nonblocking cached-only miss and full-cache parallelism cases, plus the existing failure/retry test. The native probe was `cargo test --locked --offline -p xcl --test gpu_two_pass_cache_e2e local_geometry_pso_concurrency -- --test-threads=1 --nocapture` with the local fixture described above. This measures redundant lowering in a controlled workload. Retail overlap frequency, wall-time improvement and the full workspace suite on the local fix remain unmeasured. AI use: OpenAI Codex with GPT-6.2 Astra prepared and ran the probes and implemented the local experiment; Codex coordinated and prepared this report.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 02:06 UTC · original

Tested (AMD): clean 4ddb971c748d0387cc7aed3da05e259cad255d78 (base = main 8b957bec). Windows 11 26200, Ryzen 7 5700X3D, AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Rust 1.100.0 MSVC, DXC 1.8.2502.11 (Windows SDK 10.0.26100), debug.

  • cargo test -j 4 -p xcl --no-fail-fast -- --test-threads=4 then cargo build --workspace + cargo test -p xcl --test e2e: the e2e tests need the workspace-built test title, so the first run failed 3 of them for lack of it and the rerun passed 4 of 4. Lib/other targets: 1 failed, 7 SKIPPED lines (no heap windows, refused V_CVT_F16_F32 / V_MUL_F16 / VOP3-modifier forms), 47 ignored. The one failure, gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722: res[30] = 0x1, CPU 0x7fffffff), also fails on main 8b957bec with the same seed on this GPU, so it is not from the PR.
  • Totals: 1446 passed, 1 failed (baseline fuzz seed 722, fails on main too), 47 ignored.
  • PR's own tests: geometry_compute_cache_reuses_es_gs_and_skips_errors passes; the on-device gpu_geometry_mode_es_gs_strip fixtures are part of the passing suite.

Review (by reading, no bugs found): the key (vs, gs, mem_windows, split_wave64, XCL_DIRECT_DXIL) covers every input of the compute pass; the PS goes through finish_two_pass_compiled afterwards, and the cache_allowed(Stage::Mesh) env guard is applied (pso.rs:1264-1285). Errors and defer() misses are not cached. Notes, not bugs: under XCL_DIRECT_DXIL a cached-only probe now defers at pso.rs:1240 instead of translating inline (same as console_mesh); unlike console_mesh there is no in-flight coalescing, so two workers can translate one pair twice; the key trusts a 64-bit hash without comparing the blob; the cache stops at 256 entries.

Not tested: retail smoke. The scripts/smoke.ps1 run starts with a cold-cache precompile of about 26k shaders, which did not fit this session's time budget, so I did not produce a base/head xcl-smoke pair. No runtime hit-rate or timing was measured either.

AI use: Claude Code (Claude Sonnet 5.5) ran the checks and wrote this.

**@⁠oni-swr** on GitHub · 2026-11-27 02:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2918#issuecomment-7207835577) **Tested (AMD):** clean `4ddb971c748d0387cc7aed3da05e259cad255d78` (base = main `8b957bec`). Windows 11 26200, Ryzen 7 5700X3D, AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Rust 1.100.0 MSVC, DXC 1.8.2502.11 (Windows SDK 10.0.26100), debug. - `cargo test -j 4 -p xcl --no-fail-fast -- --test-threads=4` then `cargo build --workspace` + `cargo test -p xcl --test e2e`: the `e2e` tests need the workspace-built test title, so the first run failed 3 of them for lack of it and the rerun passed 4 of 4. Lib/other targets: 1 failed, 7 `SKIPPED` lines (no heap windows, refused V_CVT_F16_F32 / V_MUL_F16 / VOP3-modifier forms), 47 ignored. The one failure, `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (seed 722: `res[30] = 0x1, CPU 0x7fffffff`), also fails on `main` 8b957bec with the same seed on this GPU, so it is not from the PR. - Totals: 1446 passed, 1 failed (baseline fuzz seed 722, fails on main too), 47 ignored. - PR's own tests: `geometry_compute_cache_reuses_es_gs_and_skips_errors` passes; the on-device `gpu_geometry_mode_es_gs_strip` fixtures are part of the passing suite. **Review (by reading, no bugs found):** the key `(vs, gs, mem_windows, split_wave64, XCL_DIRECT_DXIL)` covers every input of the compute pass; the PS goes through `finish_two_pass_compiled` afterwards, and the `cache_allowed(Stage::Mesh)` env guard is applied (`pso.rs:1264-1285`). Errors and `defer()` misses are not cached. Notes, not bugs: under `XCL_DIRECT_DXIL` a cached-only probe now defers at `pso.rs:1240` instead of translating inline (same as `console_mesh`); unlike `console_mesh` there is no in-flight coalescing, so two workers can translate one pair twice; the key trusts a 64-bit hash without comparing the blob; the cache stops at 256 entries. **Not tested:** retail smoke. The `scripts/smoke.ps1` run starts with a cold-cache precompile of about 26k shaders, which did not fit this session's time budget, so I did not produce a base/head `xcl-smoke` pair. No runtime hit-rate or timing was measured either. **AI use:** Claude Code (Claude Sonnet 5.5) ran the checks and wrote this.
Author
Owner

@⁠ettehn on GitHub · 2026-11-27 03:33 UTC · original

I measured the serial warm-cache case requested in #2876 on native Windows 11 build 26200, RTX 5070 Ti Laptop, driver 621.24, Rust 1.97.1 MSVC debug (debuginfo off), and SDK DXC 1.8.2502.11. Clean libraries at 8b957bec and 4ddb971c linked into the same synthetic harness. XCL_HEAP_WINDOWS=0, split wave64. Each process warmed both pixel variants of one synthetic ES+GS pair, then timed 100 alternating calls to the public console_geometry entry. Three interleaved base/head pairs per mode. These are ranges of the three per-process medians.

Mode main #2918
HLSL (XCL_DIRECT_DXIL=0) 2.168–2.208 ms 0.194–0.197 ms
Direct (XCL_DIRECT_DXIL=1) 4.772–4.820 ms 0.192–0.193 ms

The main-only component timing for ES/GS parsing and lowering, excluding passthrough and DXC cache lookups, was 1.039–1.076 ms for HLSL and 4.366–4.428 ms for direct. For each mode and revision, both pixel variants had identical compute bytes within the pair and distinct passthrough mesh bytes. The D3D12 fixture then created the resulting compute and mesh PSOs and drew both variants, outside the timed section. All 24 draws passed the 41-covered-pixel check and the first record reported the expected 84 vertices and 42 triangles.

This times the translation entry point after warm-up. Runtime PSO scheduling, cold concurrent misses, native driver-cache timing, and retail impact are outside the measurement.

OpenAI Codex assisted with verification.

**@⁠ettehn** on GitHub · 2026-11-27 03:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2918#issuecomment-7209091419) I measured the serial warm-cache case requested in #2876 on native Windows 11 build 26200, RTX 5070 Ti Laptop, driver 621.24, Rust 1.97.1 MSVC debug (debuginfo off), and SDK DXC 1.8.2502.11. Clean libraries at `8b957bec` and `4ddb971c` linked into the same synthetic harness. `XCL_HEAP_WINDOWS=0`, split wave64. Each process warmed both pixel variants of one synthetic ES+GS pair, then timed 100 alternating calls to the public `console_geometry` entry. Three interleaved base/head pairs per mode. These are ranges of the three per-process medians. | Mode | `main` | #2918 | | --- | ---: | ---: | | HLSL (`XCL_DIRECT_DXIL=0`) | 2.168–2.208 ms | 0.194–0.197 ms | | Direct (`XCL_DIRECT_DXIL=1`) | 4.772–4.820 ms | 0.192–0.193 ms | The main-only component timing for ES/GS parsing and lowering, excluding passthrough and DXC cache lookups, was 1.039–1.076 ms for HLSL and 4.366–4.428 ms for direct. For each mode and revision, both pixel variants had identical compute bytes within the pair and distinct passthrough mesh bytes. The D3D12 fixture then created the resulting compute and mesh PSOs and drew both variants, outside the timed section. All 24 draws passed the 41-covered-pixel check and the first record reported the expected 84 vertices and 42 triangles. This times the translation entry point after warm-up. Runtime PSO scheduling, cold concurrent misses, native driver-cache timing, and retail impact are outside the measurement. OpenAI Codex assisted with verification.
Author
Owner

@⁠SzczepanGrela on GitHub · 2026-11-27 04:44 UTC · original

RX 9070 / RADV / Wine check of public console_geometry, comparing exact head 4ddb971c748d0387cc7aed3da05e259cad255d78 with its base/current main 8b957bec6f82495aec940944c6bf47faa02db590. This adds native-wave64 and split-wave64 render/readback coverage on this environment.

Tested

  • RX 9070 16 GB, RADV GFX1201 / Mesa 26.3.1-arch3.5, Ryzen 7 7700, CachyOS 7.3.0-5-cachyos. Windows GNU release executables, Rust 1.97.1, GE-Proton11-12 / Wine 11.0 Staging, native DXGI/D3D12 through vkd3d-proton 8293130ebe370b1+ (local asserts-disabled build), DXC/DXIL 1.9.2602.17.
  • Separate source copies with identical added synthetic test and cfg(test) thread-local counter immediately before the actual geometry_program call. Original tests/assertions and production value flow preserved. Build each: cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run --message-format=json-render-diagnostics.
  • Original filters through Wine: <unit.exe> gpu_geometry_mode_es_gs_strip geometry_compute_cache_reuses_es_gs_and_skips_errors --nocapture --test-threads=1, then --test-threads=4. Main: 2 passed, 0 failed each; head: 3 passed, 0 failed each.
  • Added filter: <unit.exe> workflow_console_geometry_cache_native --nocapture --test-threads=1. Three fresh processes per source and backend (XCL_DIRECT_DXIL=0/1): 1 passed, 0 failed in all 12 runs. Both requested translation paths confirmed from captured DXIL.

In each added run, call public console_geometry serially with (GS, PS) sequence (0,0), (0,1), (0,2), (1,0), (1,1), (0,0), first native wave64, then split wave64 in the same process. VS bytes stay fixed; GS 0/1 emit green/blue. PS variants consume TEXCOORD0, consume absent COLOR0 with a red offset, or return constant blue. Effective mem_windows=4 stays fixed.

Per six-call sequence Main Head
Actual ES+GS lowering entries 6 2
Per-call increments 1,1,1,1,1,1 1,0,0,1,0,0

Both wave modes give those counts: 12 versus 4 lowerings per process. Compute containers remain identical across PS changes and differ across GS changes. Mesh containers differ across the three PS signatures and remain identical across GS colors. Changing to split mode produces separate cold entries.

Every returned compute/mesh pair creates native PSOs and executes through the plain-PC mesh_draw_split runner. 144 two-pass draws across the added runs: 72 native-wave64 geometry dispatches and 72 split-wave64 geometry dispatches with wave32 metadata. Separate physical-width probes return 32/64 in every lane. All 64 RGBA32F pixels and all 529 record words per draw match independently recomputed expectations, including triangle indices and unused record words. 114,576 record/pixel/width words checked. Render payloads agree across source arms/backends; captures repeat byte-for-byte within each configuration. 0 ignored, 0 skipped.

Inherited XCL_* cleared; XCL_NETWORK=0, RX 9070 selected, XCL_REQUIRE_GPU=wave64, XCL_DXC_THREADS=1; private enabled caches per process.

Not tested

Concurrent miss coalescing, capacity/eviction, end-to-end deferred/error paths, varying memory-window configurations or flat memory-window loads, adopted HLE graphics-PSO creation hooks, full suite, native Windows, other GPUs, retail workload, scripts/smoke.ps1, timing or FPS. This tests the public translation/cache entry and native execution of its returned shaders.

AI use

OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, wrote the added test-only fixture/counter and captures, ran comparisons, independently verified encoded GS changes, complete readbacks, counters, wave metadata and source/executable provenance, and drafted this report. Publication authorized by the account owner.

**@⁠SzczepanGrela** on GitHub · 2026-11-27 04:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2918#issuecomment-7210054082) RX 9070 / RADV / Wine check of public `console_geometry`, comparing exact head `4ddb971c748d0387cc7aed3da05e259cad255d78` with its base/current main `8b957bec6f82495aec940944c6bf47faa02db590`. This adds native-wave64 and split-wave64 render/readback coverage on this environment. **Tested** - RX 9070 16 GB, RADV GFX1201 / Mesa `26.3.1-arch3.5`, Ryzen 7 7700, CachyOS `7.3.0-5-cachyos`. Windows GNU release executables, Rust `1.97.1`, GE-Proton11-12 / Wine 11.0 Staging, native DXGI/D3D12 through vkd3d-proton `8293130ebe370b1+` (local asserts-disabled build), DXC/DXIL `1.9.2602.17`. - Separate source copies with identical added synthetic test and `cfg(test)` thread-local counter immediately before the actual `geometry_program` call. Original tests/assertions and production value flow preserved. Build each: `cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run --message-format=json-render-diagnostics`. - Original filters through Wine: `<unit.exe> gpu_geometry_mode_es_gs_strip geometry_compute_cache_reuses_es_gs_and_skips_errors --nocapture --test-threads=1`, then `--test-threads=4`. Main: **2 passed, 0 failed** each; head: **3 passed, 0 failed** each. - Added filter: `<unit.exe> workflow_console_geometry_cache_native --nocapture --test-threads=1`. Three fresh processes per source and backend (`XCL_DIRECT_DXIL=0/1`): **1 passed, 0 failed** in all 12 runs. Both requested translation paths confirmed from captured DXIL. In each added run, call public `console_geometry` serially with `(GS, PS)` sequence `(0,0), (0,1), (0,2), (1,0), (1,1), (0,0)`, first native wave64, then split wave64 in the same process. VS bytes stay fixed; GS 0/1 emit green/blue. PS variants consume `TEXCOORD0`, consume absent `COLOR0` with a red offset, or return constant blue. Effective `mem_windows=4` stays fixed. | Per six-call sequence | Main | Head | |---|---:|---:| | Actual ES+GS lowering entries | 6 | 2 | | Per-call increments | 1,1,1,1,1,1 | 1,0,0,1,0,0 | Both wave modes give those counts: **12 versus 4 lowerings per process**. Compute containers remain identical across PS changes and differ across GS changes. Mesh containers differ across the three PS signatures and remain identical across GS colors. Changing to split mode produces separate cold entries. Every returned compute/mesh pair creates native PSOs and executes through the plain-PC `mesh_draw_split` runner. **144 two-pass draws** across the added runs: 72 native-wave64 geometry dispatches and 72 split-wave64 geometry dispatches with wave32 metadata. Separate physical-width probes return 32/64 in every lane. All 64 RGBA32F pixels and all 529 record words per draw match independently recomputed expectations, including triangle indices and unused record words. **114,576 record/pixel/width words checked**. Render payloads agree across source arms/backends; captures repeat byte-for-byte within each configuration. **0 ignored, 0 skipped**. Inherited `XCL_*` cleared; `XCL_NETWORK=0`, RX 9070 selected, `XCL_REQUIRE_GPU=wave64`, `XCL_DXC_THREADS=1`; private enabled caches per process. **Not tested** Concurrent miss coalescing, capacity/eviction, end-to-end deferred/error paths, varying memory-window configurations or flat memory-window loads, adopted HLE graphics-PSO creation hooks, full suite, native Windows, other GPUs, retail workload, `scripts/smoke.ps1`, timing or FPS. This tests the public translation/cache entry and native execution of its returned shaders. **AI use** OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, wrote the added test-only fixture/counter and captures, ran comparisons, independently verified encoded GS changes, complete readbacks, counters, wave metadata and source/executable provenance, and drafted this report. Publication authorized by the account owner.
Author
Owner

@⁠LocranKing on GitHub · 2026-11-27 10:00 UTC · original

Tested PR #2918 (4ddb971c) against main (8b957bec) on Windows 11 (26300), Ryzen 5 5500 (6C/12T), RTX 3060 Ti 8 GiB (driver 621.40), rustc 1.100.0, DXC 1.9.2602.17.

Unit Test (cargo test --locked -p xcl)

  • gpu::recomp::pso::shader_cache_tests::geometry_compute_cache_reuses_es_gs_and_skips_errors: 1 passed, 0 failed.

Paired 180 s Retail Smoke (9cc6a39e, Series S lockhart, XCL_HEAP_WINDOWS=1, XCL_DIRECT_DXIL=all, XCL_DIRECT_SPLIT_INSTRUCTIONS=0, XCL_PSO_WAIT_MS=50)

Build Guest entry / World load Frames shown World presents Peak commit Peak local / non-local VRAM Console stats Crashes / Removals
main (8b957bec) 67.2 s / 188.4 s 1240 14 (28 windows) 29,411 MB 14,281 / 2,241 MB 9,178 draws, 34,068 dispatches 0 / 0 (exit: 0x0)
PR #2918 (4ddb971c) 71.0 s / 190.5 s 1228 17 (29 windows) 30,137 MB 14,624 / 2,407 MB 13,298 draws, 34,179 dispatches 0 / 0 (exit: 0x0)

Zero crashes, zero device removals (exit: 0x0).

Not tested: Serial warm-cache console_geometry timing microbenchmark (#2876), or legacy ES+GS two-pass geometry draws in-title (none were logged during this 60.5 s world window).

**@⁠LocranKing** on GitHub · 2026-11-27 10:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2918#issuecomment-7215365136) Tested PR #2918 (`4ddb971c`) against `main` (`8b957bec`) on Windows 11 (26300), Ryzen 5 5500 (6C/12T), RTX 3060 Ti 8 GiB (driver `621.40`), `rustc 1.100.0`, DXC `1.9.2602.17`. ### Unit Test (`cargo test --locked -p xcl`) - `gpu::recomp::pso::shader_cache_tests::geometry_compute_cache_reuses_es_gs_and_skips_errors`: **`1 passed, 0 failed`**. ### Paired 180 s Retail Smoke (`9cc6a39e`, Series S `lockhart`, `XCL_HEAP_WINDOWS=1`, `XCL_DIRECT_DXIL=all`, `XCL_DIRECT_SPLIT_INSTRUCTIONS=0`, `XCL_PSO_WAIT_MS=50`) | Build | Guest entry / World load | Frames shown | World presents | Peak commit | Peak local / non-local VRAM | Console stats | Crashes / Removals | | --- | --- | --- | --- | --- | --- | --- | --- | | `main` (`8b957bec`) | `67.2 s` / `188.4 s` | `1240` | `14` (`28` windows) | `29,411 MB` | `14,281 / 2,241 MB` | `9,178` draws, `34,068` dispatches | `0 / 0` (`exit: 0x0`) | | PR #2918 (`4ddb971c`) | `71.0 s` / `190.5 s` | `1228` | `17` (`29` windows) | `30,137 MB` | `14,624 / 2,407 MB` | `13,298` draws, `34,179` dispatches | `0 / 0` (`exit: 0x0`) | Zero crashes, zero device removals (`exit: 0x0`). **Not tested:** Serial warm-cache `console_geometry` timing microbenchmark (#2876), or legacy `ES+GS` two-pass geometry draws in-title (none were logged during this `60.5 s` world window).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2918/head:github-bot/gh-2918'
git switch 'github-bot/gh-2918'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2918'
git switch 'github-bot/gh-2918'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2918'
git switch 'github-bot/gh-2918'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2918'
git switch 'main'
git merge --squash 'github-bot/gh-2918'
git switch 'main'
git merge --ff-only 'github-bot/gh-2918'
git switch 'main'
git merge 'github-bot/gh-2918'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.