Shaders: key HLSL dumps by program within each FSSM #1747

Open
NemesisDawn wants to merge 1 commit from upstream-pr/1757 into main
NemesisDawn commented 2026-11-24 20:17:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by NemesisDawn on 2026-11-24T20:17:39Z.


Include the program offset in the dump key when an FSSM holds multiple programs, so the programs produce distinct files and can each be selected by hash.

What is in it

  • crates/xcl/src/shaders.rs assigns per-program keys. crates/xcl/tests/shaders_e2e.rs covers dumping and selecting both programs in a synthetic FSSM.

Tested

  • At 9a21dc0, the regression passed on Windows using a standalone fixture compiled with rustc 1.100.0. The fixture extracted the changed code from the published commit and used synthetic shader data.

Regression run

  • Pending comparable retail-title runs on upstream main and this PR’s commit.

Not tested

  • Full XCL build, Cargo workspace suite on a GPU, and retail-title smoke runs.

AI use

  • OpenAI Codex (GPT-6, exact variant unavailable) wrote the patch and regression tests, ran the focused checks, and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5479637629 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1757). Originally posted by [NemesisDawn](https://github.com/NemesisDawn) on 2026-11-24T20:17:39Z. --- Include the program offset in the dump key when an FSSM holds multiple programs, so the programs produce distinct files and can each be selected by hash. **What is in it** - `crates/xcl/src/shaders.rs` assigns per-program keys. `crates/xcl/tests/shaders_e2e.rs` covers dumping and selecting both programs in a synthetic FSSM. **Tested** - At `9a21dc0`, the regression passed on Windows using a standalone fixture compiled with `rustc` 1.100.0. The fixture extracted the changed code from the published commit and used synthetic shader data. **Regression run** - Pending comparable retail-title runs on upstream `main` and this PR’s commit. **Not tested** - Full XCL build, Cargo workspace suite on a GPU, and retail-title smoke runs. **AI use** - OpenAI Codex (GPT-6, exact variant unavailable) wrote the patch and regression tests, ran the focused checks, and drafted this description.
futurepro62 commented 2026-11-24 21:30:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T21:20:21Z.


Full-suite run, since this PR has no test report yet. Tested exact head 9a21dc0 (on its base 85e3826).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 874 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: shaders_dump_and_select_individual_programs_in_one_fssm.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 876 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Two tests were skipped with --skip on NVIDIA. Both fail on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. heap_window_out_of_memory_falls_back_to_the_switch_form skips when XCL_HEAP_WINDOWS is unset (#1651), and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record skipped because Developer Mode was off. Developer Mode was turned on before the AMD run, and there pso_measurement_compiles_an_exact_synthetic_record ran and passed.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7144797218 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1757#issuecomment-7144797218). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T21:20:21Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `9a21dc0` (on its base `85e3826`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record`: **874 passed, 0 failed, 42 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `shaders_dump_and_select_individual_programs_in_one_fssm`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **876 passed, 0 failed, 42 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Two tests were skipped with `--skip` on NVIDIA. Both fail on main `7f7e768` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns their skips into failures. `heap_window_out_of_memory_falls_back_to_the_switch_form` skips when `XCL_HEAP_WINDOWS` is unset (#1651), and `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` skipped because Developer Mode was off. Developer Mode was turned on before the AMD run, and there `pso_measurement_compiles_an_exact_synthetic_record` ran and passed. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Toons29 commented 2026-11-24 22:06:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-24T21:43:25Z.


Regression run of 9a21dc0a on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 9a21dc0ab819db2bd24c6516a9e54e3a0390cedd
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1631 (PresentX 1631)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14686 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 99 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7145303921 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1757#issuecomment-7145303921). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-24T21:43:25Z. --- Regression run of `9a21dc0a` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 9a21dc0ab819db2bd24c6516a9e54e3a0390cedd gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1631 (PresentX 1631) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14686 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 99 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
DavidM1911 commented 2026-11-24 23:08:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T23:04:42Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7146986689 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1757#issuecomment-7146986689). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T23:04:42Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
github-actions[bot] commented 2026-11-28 08:01:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:02Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7236307026 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1757#issuecomment-7236307026). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:01:02Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 06:40:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:40:36Z.


Triage (#1607) – head 9a21dc0

No open or merged PR makes the same change; on main Agg still names every program of an FSSM {name} FSSM#{fi}, so several programs in one FSSM share one XCL_DUMP_HLSL file and one XCL_RECOMP_ONLY hash.
Adding @ offset only when an FSSM has more than one program keeps existing single-program hashes stable. The PR conflicts with main, where that rc.add call now also passes fssm_wave64; it needs a rebase.
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:7303144101 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1757#issuecomment-7303144101). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:40:36Z. --- **Triage (#1607)** – head 9a21dc0 No open or merged PR makes the same change; on main `Agg` still names every program of an FSSM `{name} FSSM#{fi}`, so several programs in one FSSM share one `XCL_DUMP_HLSL` file and one `XCL_RECOMP_ONLY` hash. Adding `@ offset` only when an FSSM has more than one program keeps existing single-program hashes stable. The PR conflicts with main, where that `rc.add` call now also passes `fssm_wave64`; it needs a rebase. 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/1757:upstream-pr/1757'
git switch 'upstream-pr/1757'

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