Shaders: classify translated resource heap dependencies #2785

Open
ZekkJJ wants to merge 1 commit from upstream-pr/2795 into main
ZekkJJ commented 2026-11-26 13:36:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ZekkJJ on 2026-11-26T13:36:12Z.


Collect conservative direct resource-heap dependencies from reachable instructions in emitted DXIL. This prepares submission-side experiments and leaves shader bytes, descriptor publication, and tile mapping unchanged.

What is in it

  • descriptor_access.rs finds finite sets of slots through constants, selects, and finite phi expressions. An unresolved resource index represents the whole heap. Sampler accesses and root register bindings are accounted for separately.
  • XCL_DXIL_HEAP_ACCESS=1 reports emitted-module totals. Cached DXIL and HLSL fallback coverage are outside this census.

Tested

  • ee06111f923bf07978b5ac66de4bbbb0fd150f4b on RTX 4060 Laptop, driver 32.0.16.1656, Ryzen 7 8845HS, Windows build 26200, Rust 1.98.1, debug tests.
  • With XCL_ADAPTER=4060 and XCL_DXIL_HEAP_ACCESS=1, cargo test --offline --locked -p xcl --lib -j 1 -- 'gpu::dxil::' --nocapture --test-threads=1 reported 187 passed, 0 failed, and 3 ignored. One of the 187 reported passes printed SKIPPED because the adapter cannot run wave64.
  • The new tests covered direct slot unions through selects and phi nodes, unreachable code, sampler separation, register bindings, dynamic indices, loop-carried values, and the analysis size limit.

Regression run

The required main and clean-head xcl-smoke pair is pending. This revision is for draft review.

Not tested

  • Full workspace, independent AMD, retail world entry, and cross-queue pixel readback through live physical aliases. The draft measures shader analysis only. Submission-driven lazy backing is still experimental.

AI use

OpenAI Codex (GPT-6) wrote the implementation, tests, and draft description, ran the tests, and inspected the results. The implementation is independent of the Cool Fox source code.

<!-- greyfinch-sync:ivall/xcl:issue:5511021601 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2795). Originally posted by [ZekkJJ](https://github.com/ZekkJJ) on 2026-11-26T13:36:12Z. --- Collect conservative direct resource-heap dependencies from reachable instructions in emitted DXIL. This prepares submission-side experiments and leaves shader bytes, descriptor publication, and tile mapping unchanged. **What is in it** - `descriptor_access.rs` finds finite sets of slots through constants, selects, and finite phi expressions. An unresolved resource index represents the whole heap. Sampler accesses and root register bindings are accounted for separately. - `XCL_DXIL_HEAP_ACCESS=1` reports emitted-module totals. Cached DXIL and HLSL fallback coverage are outside this census. **Tested** - `ee06111f923bf07978b5ac66de4bbbb0fd150f4b` on RTX 4060 Laptop, driver `32.0.16.1656`, Ryzen 7 8845HS, Windows build 26200, Rust 1.98.1, debug tests. - With `XCL_ADAPTER=4060` and `XCL_DXIL_HEAP_ACCESS=1`, `cargo test --offline --locked -p xcl --lib -j 1 -- 'gpu::dxil::' --nocapture --test-threads=1` reported 187 passed, 0 failed, and 3 ignored. One of the 187 reported passes printed `SKIPPED` because the adapter cannot run wave64. - The new tests covered direct slot unions through selects and phi nodes, unreachable code, sampler separation, register bindings, dynamic indices, loop-carried values, and the analysis size limit. **Regression run** The required main and clean-head `xcl-smoke` pair is pending. This revision is for draft review. **Not tested** - Full workspace, independent AMD, retail world entry, and cross-queue pixel readback through live physical aliases. The draft measures shader analysis only. Submission-driven lazy backing is still experimental. **AI use** OpenAI Codex (GPT-6) wrote the implementation, tests, and draft description, ran the tests, and inspected the results. The implementation is independent of the Cool Fox source code.
ettehn commented 2026-11-26 14:03:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-26T13:43:19Z.


Independent Windows check on ee06111f923bf07978b5ac66de4bbbb0fd150f4b. I added two local test probes and left the implementation untouched.

  • Analysis budget: a shared select expression with 63 recursive visits resolved to slot {20}. Expanding it to 127 possible visits returned unknown despite the expression having only one distinct slot, confirming the separate 64-node proof cutoff.
  • Emission parity: two fresh test processes emitted the same three synthetic compute containers with XCL_DXIL_HEAP_ACCESS=0 and =1. All three pairs matched byte for byte (1,320 B register UAV, 1,132 B constant heap UAV, 1,188 B dynamic heap UAV). The disabled run printed no census. The enabled run counted one no-resource-heap module, one finite, and one unknown, with one register binding.

Windows 11 build 26200, Rust 1.97.1 MSVC debug. cargo test --locked --offline -p xcl --lib -j 2 -- gpu::dxil::module::descriptor_access::tests:: --test-threads=1 --nocapture passed 5 tests with the census off. Rerunning only census_emission_probe with the census on passed 1 test. No ignored or failed tests in either run. These checks cover in-process DXIL analysis and container emission. GPU execution, the workspace suite, and a retail title were outside this run.

OpenAI Codex assisted with the probes and verification. The exact model identifier was unavailable in this session.

<!-- greyfinch-sync:ivall/xcl:comment:7193744595 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2795#issuecomment-7193744595). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-26T13:43:19Z. --- Independent Windows check on `ee06111f923bf07978b5ac66de4bbbb0fd150f4b`. I added two local test probes and left the implementation untouched. - **Analysis budget**: a shared select expression with 63 recursive visits resolved to slot `{20}`. Expanding it to 127 possible visits returned unknown despite the expression having only one distinct slot, confirming the separate 64-node proof cutoff. - **Emission parity**: two fresh test processes emitted the same three synthetic compute containers with `XCL_DXIL_HEAP_ACCESS=0` and `=1`. All three pairs matched byte for byte (1,320 B register UAV, 1,132 B constant heap UAV, 1,188 B dynamic heap UAV). The disabled run printed no census. The enabled run counted one no-resource-heap module, one finite, and one unknown, with one register binding. Windows 11 build 26200, Rust 1.97.1 MSVC debug. `cargo test --locked --offline -p xcl --lib -j 2 -- gpu::dxil::module::descriptor_access::tests:: --test-threads=1 --nocapture` passed 5 tests with the census off. Rerunning only `census_emission_probe` with the census on passed 1 test. No ignored or failed tests in either run. These checks cover in-process DXIL analysis and container emission. GPU execution, the workspace suite, and a retail title were outside this run. OpenAI Codex assisted with the probes and verification. The exact model identifier was unavailable in this session.
Anon64 commented 2026-11-26 14:03:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-26T13:51:50Z.


Regression run of ee06111 on a newer retail title: no device removal, no crash, frames and commit within the limits.

Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main b49be18 (this PR's base) and of this PR's exact head, run back to back, scripts/smoke.ps1 -Game <title> for 60 s with XCL_NETWORK=0 and A pressed every 4 s from 20 s.

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1494 (PresentX 1494)
presents per 2 s (last 3): 40 9 0
device removals: 0
crashes: 0
peak commit: 22986 MB

this PR:

xcl-smoke v1
commit: ee06111f923bf07978b5ac66de4bbbb0fd150f4b
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1470 (PresentX 1470)
presents per 2 s (last 3): 9 1 5
device removals: 0
crashes: 0
peak commit: 23000 MB

98 % of main's frames, 100 % of its peak commit. One run each.

Not tested: the suite on this head; AMD.

AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7193942041 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2795#issuecomment-7193942041). Originally posted by [Anon64](https://github.com/Anon64) on 2026-11-26T13:51:50Z. --- **Regression run of `ee06111` on a newer retail title: no device removal, no crash, frames and commit within the limits.** **Setup:** RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main `b49be18` (this PR's base) and of this PR's exact head, run back to back, `scripts/smoke.ps1 -Game <title>` for 60 s with `XCL_NETWORK=0` and A pressed every 4 s from 20 s. main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1494 (PresentX 1494) presents per 2 s (last 3): 40 9 0 device removals: 0 crashes: 0 peak commit: 22986 MB ``` this PR: ``` xcl-smoke v1 commit: ee06111f923bf07978b5ac66de4bbbb0fd150f4b gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1470 (PresentX 1470) presents per 2 s (last 3): 9 1 5 device removals: 0 crashes: 0 peak commit: 23000 MB ``` 98 % of main's frames, 100 % of its peak commit. One run each. **Not tested:** the suite on this head; AMD. AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.
github-actions[bot] commented 2026-12-01 02:34:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:34:33Z.


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:7298763238 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2795#issuecomment-7298763238). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:34:33Z. --- 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 08:58:10 +00:00 (Migrated from github.com)

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


Triage (#1607) – head ee06111

No open or merged PR adds this classification. Main's Module::referenced_bindings covers only createHandleFromBinding ranges. The new descriptor_access is an opt-in counter (XCL_DXIL_HEAP_ACCESS=1) run in try_to_bitcode, and nothing uses its result yet. The build check passes; only the description check fails (draft).
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:7306028798 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2795#issuecomment-7306028798). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:58:10Z. --- **Triage (#1607)** – head ee06111 No open or merged PR adds this classification. Main's `Module::referenced_bindings` covers only `createHandleFromBinding` ranges. The new `descriptor_access` is an opt-in counter (`XCL_DXIL_HEAP_ACCESS=1`) run in `try_to_bitcode`, and nothing uses its result yet. The build check passes; only the description check fails (draft). 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/2795:upstream-pr/2795'
git switch 'upstream-pr/2795'

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