feat(startup): implement bounded compute pipelines and native gfx1013… #1947

Open
ArnabSaga wants to merge 1 commit from upstream-pr/1954 into main
ArnabSaga commented 2026-11-24 22:06:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ArnabSaga on 2026-11-24T22:06:42Z.


… execution fixtures

Implement and validate source-built compute execution through the existing Xbox2Windows startup D3D12 wrapper.

Compute pipeline support

  • Implement bounded Scarlett DXIL compute pipeline creation for device slot 62.
  • Enable command-list Dispatch through the existing slot 14 execution path.
  • Support compute root SRV, UAV and 32-bit constant bindings.
  • Enforce root-argument completeness, resource bounds and pipeline compatibility.
  • Preserve graphics pipeline isolation and existing startup behavior.

Native gfx1013 translation and cache

  • Reuse the existing compute_store_aot translator for native compute programs.
  • Add source-built 1-D and 2-D gfx1013 compute fixtures.
  • Implement deterministic revision-2 native compute cache records and manifests.
  • Enforce SHA-256 integrity, dependency identity and strict cache acceptance.
  • Add token-owned writer locking, atomic publication and corrupt-request quarantine.
  • Validate and sign generated desktop DXIL using the existing DXC infrastructure.

C++ runtime integration

  • Implement bounded native cache parsing and Python/C++ hash parity.
  • Create desktop root signatures and compute PSOs from verified shader bytes.
  • Introduce explicitly gated native compute fixture integration.
  • Reuse the existing compute Dispatch infrastructure.
  • Enforce fixture activation, resource extents and supported execution profiles.
  • Preserve production slot 67 placeholder behavior.

GPU execution and verification

  • Verify exact fenced GPU readback on WARP and Intel Iris Xe.
  • Cover full, partial and zero-active guards, split constants, clipping and repeated Dispatch.
  • Add runtime refusal, cache corruption and comparison-sensitivity controls.
  • Preserve independent per-adapter and per-mode verification artifacts.
  • Verify fresh-cache regeneration directly from source-built native programs.

Test results

  • Offline native cache: 156/156 checks passed.
  • C++ cache controls: 195/195 passed.
  • Python/C++ acceptance parity: 92/92 matched.
  • Native CTest: 8/8 passed.
  • Normal GPU execution: 74/74 checks per adapter.
  • Debug GPU execution: 78/78 checks per adapter.
  • Independent readback verification: 96/96 comparisons matched.
  • Frozen regression suite: 29 passed, 0 failed, 1 documented capability skip.
  • Graphics and shader regressions: 8/8 passed.
  • Zero reported debug-layer warnings, errors, corruption or device removals.
  • Documentation, bidi and diff checks passed.

Documentation and scope

  • Document native compute architecture, cache regeneration and reproduction procedures.
  • Document fixture activation, supported profiles and known limitations.
  • Keep production slot 67 descriptor parsing, ExecuteIndirect and general title compatibility outside this implementation.

Related to #1412.

Change

Describe the observable change and the task or milestone it advances, or the
independent problem it solves. Link related issues with Refs #123 or
Fixes #123. If the change touches a shared interface, name it and link any
overlapping work or PR that must land first. For a documentation patch,
identify the contributor task the edit helps someone complete.

Verification

Give the commit or build, command and result. For GPU changes include the
adapter, backend, first mismatch if any, and capability skips. If you could not
run a check, say so and identify the missing prerequisite.

Evidence and follow-up

For new fixtures, describe their source or generation method and license.
Identify assumptions that affect the result and link any work another
contributor can pick up.

If this changes what contributors can run, link the updated README entry or
build step and the reproduction command. For a local-data result, identify the
part the public fixture verifies.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

If this change was AI-assisted, say so in the description. Recent contributions
follow this practice.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5481125824 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1954). Originally posted by [ArnabSaga](https://github.com/ArnabSaga) on 2026-11-24T22:06:42Z. --- … execution fixtures Implement and validate source-built compute execution through the existing Xbox2Windows startup D3D12 wrapper. ### Compute pipeline support - Implement bounded Scarlett DXIL compute pipeline creation for device slot 62. - Enable command-list Dispatch through the existing slot 14 execution path. - Support compute root SRV, UAV and 32-bit constant bindings. - Enforce root-argument completeness, resource bounds and pipeline compatibility. - Preserve graphics pipeline isolation and existing startup behavior. ### Native gfx1013 translation and cache - Reuse the existing compute_store_aot translator for native compute programs. - Add source-built 1-D and 2-D gfx1013 compute fixtures. - Implement deterministic revision-2 native compute cache records and manifests. - Enforce SHA-256 integrity, dependency identity and strict cache acceptance. - Add token-owned writer locking, atomic publication and corrupt-request quarantine. - Validate and sign generated desktop DXIL using the existing DXC infrastructure. ### C++ runtime integration - Implement bounded native cache parsing and Python/C++ hash parity. - Create desktop root signatures and compute PSOs from verified shader bytes. - Introduce explicitly gated native compute fixture integration. - Reuse the existing compute Dispatch infrastructure. - Enforce fixture activation, resource extents and supported execution profiles. - Preserve production slot 67 placeholder behavior. ### GPU execution and verification - Verify exact fenced GPU readback on WARP and Intel Iris Xe. - Cover full, partial and zero-active guards, split constants, clipping and repeated Dispatch. - Add runtime refusal, cache corruption and comparison-sensitivity controls. - Preserve independent per-adapter and per-mode verification artifacts. - Verify fresh-cache regeneration directly from source-built native programs. ### Test results - Offline native cache: 156/156 checks passed. - C++ cache controls: 195/195 passed. - Python/C++ acceptance parity: 92/92 matched. - Native CTest: 8/8 passed. - Normal GPU execution: 74/74 checks per adapter. - Debug GPU execution: 78/78 checks per adapter. - Independent readback verification: 96/96 comparisons matched. - Frozen regression suite: 29 passed, 0 failed, 1 documented capability skip. - Graphics and shader regressions: 8/8 passed. - Zero reported debug-layer warnings, errors, corruption or device removals. - Documentation, bidi and diff checks passed. ### Documentation and scope - Document native compute architecture, cache regeneration and reproduction procedures. - Document fixture activation, supported profiles and known limitations. - Keep production slot 67 descriptor parsing, ExecuteIndirect and general title compatibility outside this implementation. Related to #1412. ## Change Describe the observable change and the task or milestone it advances, or the independent problem it solves. Link related issues with `Refs #123` or `Fixes #123`. If the change touches a shared interface, name it and link any overlapping work or PR that must land first. For a documentation patch, identify the contributor task the edit helps someone complete. ## Verification Give the commit or build, command and result. For GPU changes include the adapter, backend, first mismatch if any, and capability skips. If you could not run a check, say so and identify the missing prerequisite. ## Evidence and follow-up For new fixtures, describe their source or generation method and license. Identify assumptions that affect the result and link any work another contributor can pick up. If this changes what contributors can run, link the updated README entry or build step and the reproduction command. For a local-data result, identify the part the public fixture verifies. ## Checklist - [ ] This pull request covers one reviewable behavior. - [ ] I included the exact command and result for every check I ran. - [ ] I considered a negative control or failure case for a new fixture. - [ ] I updated README/docs when a capability or build requirement changed. - [ ] I did not include game files, dumps, distribution links or secrets. If this change was AI-assisted, say so in the description. Recent contributions follow this practice.
ArnabSaga commented 2026-11-24 23:03:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ArnabSaga on 2026-11-24T22:17:49Z.


I've completed an initial upstream compatibility review. Since this implementation was developed against an earlier baseline, the current upstream compute infrastructure has evolved significantly.

I'm keeping this PR as a draft/reference while evaluating a smaller, independently reviewable native compute translation and cache contribution. The existing implementation and its local verification evidence are preserved.

I'd appreciate guidance on the preferred integration boundary, particularly regarding the overlapping slot 62 work in #1441.

The reported verification results apply to my original local implementation, not a merged current-upstream snapshot.

AI-assisted implementation and review.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146054586 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1954#issuecomment-7146054586). Originally posted by [ArnabSaga](https://github.com/ArnabSaga) on 2026-11-24T22:17:49Z. --- I've completed an initial upstream compatibility review. Since this implementation was developed against an earlier baseline, the current upstream compute infrastructure has evolved significantly. I'm keeping this PR as a draft/reference while evaluating a smaller, independently reviewable native compute translation and cache contribution. The existing implementation and its local verification evidence are preserved. I'd appreciate guidance on the preferred integration boundary, particularly regarding the overlapping slot 62 work in #1441. The reported verification results apply to my original local implementation, not a merged current-upstream snapshot. AI-assisted implementation and review.
R0Y00 commented 2026-11-24 23:03:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T22:27:36Z.


Thanks for preserving the broader work as a draft. For the first independent slice, target one source-built compute shader and the existing upstream request/cache and slot 62 path. Please coordinate with #1441 on that path and use #1974/#1975 for their dispatch/root-binding work. A focused translation/cache contribution should show one native compute PSO and an exact fenced UAV readback, with a different shader or incompatible root binding proving cache lookup cannot reuse the wrong PSO. Avoid a second slot 62 implementation. The original local results can stay attached to this draft as reference.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146255159 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1954#issuecomment-7146255159). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T22:27:36Z. --- Thanks for preserving the broader work as a draft. For the first independent slice, target one source-built compute shader and the existing upstream request/cache and slot 62 path. Please coordinate with #1441 on that path and use #1974/#1975 for their dispatch/root-binding work. A focused translation/cache contribution should show one native compute PSO and an exact fenced UAV readback, with a different shader or incompatible root binding proving cache lookup cannot reuse the wrong PSO. Avoid a second slot 62 implementation. The original local results can stay attached to this draft as reference.
tedin7 commented 2026-11-27 09:37:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T09:37:05Z.


This PR now conflicts with main. Conflicting files:

  • docs/experiments.md
  • docs/startup-runtime.md
  • src/d3d12_xs_shim.def
  • src/startup_stubs/d3d12_capture.inl
  • src/startup_stubs/d3d12_xs_device.cpp
  • tools/dxil_retarget.py

Could you merge main into your branch (a merge commit, no force push needed) and resolve these? Thank you.

AI-assisted; commands listed were executed locally. (git merge-tree origin/main <head>)

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7214892333 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1954#issuecomment-7214892333). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-27T09:37:05Z. --- This PR now conflicts with `main`. Conflicting files: - `docs/experiments.md` - `docs/startup-runtime.md` - `src/d3d12_xs_shim.def` - `src/startup_stubs/d3d12_capture.inl` - `src/startup_stubs/d3d12_xs_device.cpp` - `tools/dxil_retarget.py` Could you merge `main` into your branch (a merge commit, no force push needed) and resolve these? Thank you. AI-assisted; commands listed were executed locally. (`git merge-tree origin/main <head>`)
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/1954:upstream-pr/1954'
git switch 'upstream-pr/1954'

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