D3D12.X: scope native AS bindings to live recordings #2187

Open
github-bot wants to merge 5 commits from github-bot/gh-2187 into main AGit
Owner

@⁠rison1337 on GitHub · 2026-11-25 08:17 UTC · original
rison1337:feat/host-dxr-bindings → main · +1033 −20 · 12 files · 5 commits · open

Stacked on #2085 and the preceding native-AS preparation branches. Immediate predecessor: feat/host-dxr-observer (16b46ee406b6). Only commit 95b1f11aafa3 belongs to this PR; earlier commits are dependencies.

Prepare native query bindings for #1751, with conservative lifetime and ordering checks. Compatible structures are scoped to managed UMA ranges and one recording; reset, release, decommit and remapping invalidate the bindings. Shader consumption is added separately.

What is in it

  • Track guest spans, eligibility, generation and recording owner; publish no cross-recording bindings.
  • Invalidate bindings in coherent and sparse allocators, including XMemFree and partial physical-page release; reject unpublished cross-recording TLAS/clone inputs before recording commands.

Tested

  • Ryzen 5 7500F, RTX 4060 8 GB, NVIDIA 615.78.08, CachyOS Linux, Rust 1.99.1; Windows x86_64-pc-windows-gnullvm cross-build, debug tests and release runtime. Executed under Proton Experimental, with DXC 1.9.2609.5 and the local vkd3d-proton compatibility build.
  • Complete library executable on this head, cross-built with cargo test --locked --target x86_64-pc-windows-gnullvm -p xcl --lib --no-run, then run through the local Proton runner with --test-threads=4: 1103 passed, 2 failed, 26 ignored; 24 explicit SKIPPED messages. XCL_HOST_RAYQUERY=1; the private shader sample was available through XCL_SAMPLE_RAYQUERY. No title bytes are committed.
  • Fresh main (568e7db7729c), same runner and hardware: 1096 passed, 2 failed, 26 ignored; 24 explicit SKIPPED messages. Both fail the same existing depth-state negative check (gpu_depth_buffer_created_for_unordered_access_is_placed) and XMA voice check (xma2_source_voice_decodes_and_manages_lifetime). Skips include unavailable hardware wave64 and Windows Developer Mode.
  • Final stack 24206a657b11: cargo build --locked --target x86_64-pc-windows-gnullvm --workspace and cargo test --locked --target x86_64-pc-windows-gnullvm --workspace --no-run passed after adapting the four integration-test accesses to the shared-DXIL Arc API in #2085.

Regression run

The repository's unchanged scripts/smoke.ps1 generated these blocks, using PowerShell 7.7.0 on Linux and a shell wrapper that executes the EXE through Proton. Z: is mapped for reading the Windows log path. Both clean-source runs use the same title/profile copy, 90 s, XCL_PSO_PRELOAD=0, no automatic input, and a separate Xwayland surface on a background workspace. The PR's opt-in flag is enabled where available. Coverage is startup/start screen/menu, not world loading or native traversal execution.

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 4060
title: 6ca5cab7
seconds: 90
exit: 0x0
frames shown: 1828 (PresentX 1828)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB
xcl-smoke v1
commit: 95b1f11aafa381df9352e6860c7dffb5ff828ab5
gpu: NVIDIA GeForce RTX 4060
title: 6ca5cab7
seconds: 90
exit: 0x0
frames shown: 1729 (PresentX 1729)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

Both runs exited without recorded crashes or device removals. Wine prints 0 MB for process commit, so the memory-growth comparison is not established by this counter. The existing queue-drain warning may be present at timer shutdown.

Not tested

  • Native Windows, AMD and hardware wave64.
  • A green complete workspace GPU-suite run. The library failures reproduced on main are listed above; integration execution under Wine is reported separately below. Passing cases with SKIPPED output do not establish GPU coverage.
  • World loading, gameplay performance, arbitrary title geometry and cross-list/cross-queue publication. Earlier exploratory world loads hit OOM; the native consumer has not been confirmed executing in a title.
  • On final stack 24206a657b11, all 19 non-library workspace executables were attempted under Proton. e2e, pls_quota, gpu_compute_e2e and predication_e2e fail on both main and head. The resource/sync executable aborts with four test threads on both (main: access violation; head: division by zero), so no aggregate pass is claimed.
  • Resource/sync recheck with one test thread: main: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.41s; final stack: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.01s. The parallel failure cause is unresolved.

AI use

Codex (GPT-6 family; exact variant unavailable in this session) prepared the implementation, split the commits, cross-built the binaries, ran the listed Linux/Proton checks and drafted this description. No game data or console SDK headers are included.

**@⁠rison1337** on GitHub · 2026-11-25 08:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/2187) `rison1337:feat/host-dxr-bindings` → `main` · +1033 −20 · 12 files · 5 commits · open Stacked on #2085 and the preceding native-AS preparation branches. Immediate predecessor: [`feat/host-dxr-observer`](https://github.com/rison1337/xcl/tree/feat/host-dxr-observer) (`16b46ee406b6`). Only commit [`95b1f11aafa3`](https://github.com/rison1337/xcl/commit/95b1f11aafa381df9352e6860c7dffb5ff828ab5) belongs to this PR; earlier commits are dependencies. Prepare native query bindings for #1751, with conservative lifetime and ordering checks. Compatible structures are scoped to managed UMA ranges and one recording; reset, release, decommit and remapping invalidate the bindings. Shader consumption is added separately. **What is in it** - Track guest spans, eligibility, generation and recording owner; publish no cross-recording bindings. - Invalidate bindings in coherent and sparse allocators, including XMemFree and partial physical-page release; reject unpublished cross-recording TLAS/clone inputs before recording commands. **Tested** - Ryzen 5 7500F, RTX 4060 8 GB, NVIDIA 615.78.08, CachyOS Linux, Rust 1.99.1; Windows `x86_64-pc-windows-gnullvm` cross-build, debug tests and release runtime. Executed under Proton Experimental, with DXC 1.9.2609.5 and the local vkd3d-proton compatibility build. - Complete library executable on this head, cross-built with `cargo test --locked --target x86_64-pc-windows-gnullvm -p xcl --lib --no-run`, then run through the local Proton runner with `--test-threads=4`: **1103 passed, 2 failed, 26 ignored; 24 explicit SKIPPED messages**. `XCL_HOST_RAYQUERY=1`; the private shader sample was available through `XCL_SAMPLE_RAYQUERY`. No title bytes are committed. - Fresh `main` (`568e7db7729c`), same runner and hardware: **1096 passed, 2 failed, 26 ignored; 24 explicit SKIPPED messages**. Both fail the same existing depth-state negative check (`gpu_depth_buffer_created_for_unordered_access_is_placed`) and XMA voice check (`xma2_source_voice_decodes_and_manages_lifetime`). Skips include unavailable hardware wave64 and Windows Developer Mode. - Final stack `24206a657b11`: `cargo build --locked --target x86_64-pc-windows-gnullvm --workspace` and `cargo test --locked --target x86_64-pc-windows-gnullvm --workspace --no-run` passed after adapting the four integration-test accesses to the shared-DXIL `Arc` API in #2085. **Regression run** The repository's unchanged `scripts/smoke.ps1` generated these blocks, using PowerShell 7.7.0 on Linux and a shell wrapper that executes the EXE through Proton. `Z:` is mapped for reading the Windows log path. Both clean-source runs use the same title/profile copy, 90 s, `XCL_PSO_PRELOAD=0`, no automatic input, and a separate Xwayland surface on a background workspace. The PR's opt-in flag is enabled where available. Coverage is startup/start screen/menu, not world loading or native traversal execution. ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 4060 title: 6ca5cab7 seconds: 90 exit: 0x0 frames shown: 1828 (PresentX 1828) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` ``` xcl-smoke v1 commit: 95b1f11aafa381df9352e6860c7dffb5ff828ab5 gpu: NVIDIA GeForce RTX 4060 title: 6ca5cab7 seconds: 90 exit: 0x0 frames shown: 1729 (PresentX 1729) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` Both runs exited without recorded crashes or device removals. Wine prints 0 MB for process commit, so the memory-growth comparison is not established by this counter. The existing queue-drain warning may be present at timer shutdown. **Not tested** - Native Windows, AMD and hardware wave64. - A green complete workspace GPU-suite run. The library failures reproduced on main are listed above; integration execution under Wine is reported separately below. Passing cases with SKIPPED output do not establish GPU coverage. - World loading, gameplay performance, arbitrary title geometry and cross-list/cross-queue publication. Earlier exploratory world loads hit OOM; the native consumer has not been confirmed executing in a title. - On final stack `24206a657b11`, all 19 non-library workspace executables were attempted under Proton. `e2e`, `pls_quota`, `gpu_compute_e2e` and `predication_e2e` fail on both main and head. The resource/sync executable aborts with four test threads on both (main: access violation; head: division by zero), so no aggregate pass is claimed. - Resource/sync recheck with one test thread: main: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.41s; final stack: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.01s. The parallel failure cause is unresolved. **AI use** Codex (GPT-6 family; exact variant unavailable in this session) prepared the implementation, split the commits, cross-built the binaries, ran the listed Linux/Proton checks and drafted this description. No game data or console SDK headers are included.
Return the cached Arc<Compiled> to pipeline builders so repeated shader requests reuse the compiled storage. Keep the VS and PS owners alive while the driver consumes their bytecode.

Assisted-by: Codex (gpt-6.1-sol)
Prepare native input copies with checked descriptor capture, packed vertex spans and a committed allocation cap. This preparatory module is not called by title execution yet.

Assisted-by: Codex (GPT-6 family; exact variant unavailable)
Build native acceleration structures from captured inputs and retain every referenced buffer within the allocation cap. The title-facing observer is connected in the next change. GPU fixtures cover build, compact-copy, traversal and budget failure.

Assisted-by: Codex (GPT-6 family; exact variant unavailable)
Forward the original builder calls, then record bounded shadow builds on the active recording segment. Rehydration invalidates captured mappings because its additional transforms are not reproduced. The observer is disabled unless explicitly requested.

Assisted-by: Codex (GPT-6 family; exact variant unavailable)
Track compatible native structures by UMA range and recording owner. Invalidate bindings on reset, release and page remapping; cross-recording consumers retain the console path. Shader consumption is added separately.

Assisted-by: Codex (GPT-6 family; exact variant unavailable)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:22:27 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 15:39 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 15:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/2187#issuecomment-7167189476) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/xcl/src/gpu/recomp/pso.rs
  • crates/xcl/src/hle/d3d12x/title_list.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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