D3D12.X: record first use of synchronous compute PSOs #3181

Merged
bmjask merged 1 commit from upstream-pr/3181 into main 2026-11-28 16:59:41 +00:00
bmjask commented 2026-11-28 16:31:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-28T16:31:50Z.


Part of #2088. A translated compute PSO created synchronously has no pending entry, so its first bind was absent from the ordered manifest. This keeps a trace-only ready-compute registration until first bind or final release and protects cleanup from driver address reuse.

Stacked on #3175; only commit 61fdf424 belongs here. Supersedes #2409 on current main; credit to @ettehn for the original implementation and regression.

What is in it

  • pso_manifest.rs: register ready compute PSOs with generation-safe release cleanup
  • bind.rs, pso_async.rs, and real.rs: record first use through current retained binds and preserve coalesced-build identity
  • gpu_compute_e2e.rs: create a synchronous translated compute PSO, bind it twice, and require exactly one ordered ready-use event

Tested

  • Windows 11 Pro; Intel Core i9-12900K; NVIDIA GeForce RTX 4090 driver 610.88; Rust 1.100.0; debug tests and release smoke build
  • cargo test -p xcl --lib pso_manifest -- --test-threads=1: 4 passed, 0 failed
  • cargo test -p xcl --test gpu_compute_e2e synchronous_compute_manifest_records_first_bind -- --exact --nocapture --test-threads=1: 1 passed, 0 failed
  • cargo test --workspace -- --test-threads=4: 2147 passed, 0 failed, 48 ignored; 26 runtime GPU skips (wave64 unavailable, unsupported instruction cases, missing dxil.dll, and heap windows unavailable)

Regression run
Main (db3921dcc69a32be381a17b6a81c944617338c9f):

xcl-smoke v1
commit: db3921dcc69a32be381a17b6a81c944617338c9f
gpu: NVIDIA GeForce RTX 4090
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1418 (PresentX 1418)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14703 MB

This PR (61fdf424e09d701163f90de03ec7f5a3b12c234b):

xcl-smoke v1
commit: 61fdf424e09d701163f90de03ec7f5a3b12c234b
gpu: NVIDIA GeForce RTX 4090
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1449 (PresentX 1449)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14852 MB

Not tested

  • AMD or Intel GPUs
  • Long retail-title recording with XCL_PSO_MANIFEST=1; the isolated GPU regression covers the synchronous translated-compute event
  • Graphics fixed-function derivative identity; this change only completes compute first-use evidence

AI use
Codex with GPT-5 adapted #2409 to the current retained-bind and coalesced-build paths, resolved conflicts, reviewed the address-reuse cleanup, ran the reported tests and smoke, and prepared this PR.

<!-- greyfinch-sync:ivall/xcl:issue:5542306130 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3181). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-28T16:31:50Z. --- Part of #2088. A translated compute PSO created synchronously has no pending entry, so its first bind was absent from the ordered manifest. This keeps a trace-only ready-compute registration until first bind or final release and protects cleanup from driver address reuse. Stacked on #3175; only commit `61fdf424` belongs here. Supersedes #2409 on current `main`; credit to @ettehn for the original implementation and regression. **What is in it** - `pso_manifest.rs`: register ready compute PSOs with generation-safe release cleanup - `bind.rs`, `pso_async.rs`, and `real.rs`: record first use through current retained binds and preserve coalesced-build identity - `gpu_compute_e2e.rs`: create a synchronous translated compute PSO, bind it twice, and require exactly one ordered ready-use event **Tested** - Windows 11 Pro; Intel Core i9-12900K; NVIDIA GeForce RTX 4090 driver 610.88; Rust 1.100.0; debug tests and release smoke build - `cargo test -p xcl --lib pso_manifest -- --test-threads=1`: 4 passed, 0 failed - `cargo test -p xcl --test gpu_compute_e2e synchronous_compute_manifest_records_first_bind -- --exact --nocapture --test-threads=1`: 1 passed, 0 failed - `cargo test --workspace -- --test-threads=4`: 2147 passed, 0 failed, 48 ignored; 26 runtime GPU skips (wave64 unavailable, unsupported instruction cases, missing `dxil.dll`, and heap windows unavailable) **Regression run** Main (`db3921dcc69a32be381a17b6a81c944617338c9f`): ``` xcl-smoke v1 commit: db3921dcc69a32be381a17b6a81c944617338c9f gpu: NVIDIA GeForce RTX 4090 title: retail-title seconds: 60 exit: 0x0 frames shown: 1418 (PresentX 1418) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14703 MB ``` This PR (`61fdf424e09d701163f90de03ec7f5a3b12c234b`): ``` xcl-smoke v1 commit: 61fdf424e09d701163f90de03ec7f5a3b12c234b gpu: NVIDIA GeForce RTX 4090 title: retail-title seconds: 60 exit: 0x0 frames shown: 1449 (PresentX 1449) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14852 MB ``` **Not tested** - AMD or Intel GPUs - Long retail-title recording with `XCL_PSO_MANIFEST=1`; the isolated GPU regression covers the synchronous translated-compute event - Graphics fixed-function derivative identity; this change only completes compute first-use evidence **AI use** Codex with GPT-5 adapted #2409 to the current retained-bind and coalesced-build paths, resolved conflicts, reviewed the address-reuse cleanup, ran the reported tests and smoke, and prepared this PR.
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!3181
No description provided.