gpu: defer CreateCommittedResource for read-only slot 133 textures #2765

Merged
triggered02 merged 18 commits from upstream-pr/2773 into main 2026-12-03 17:16:29 +00:00
triggered02 commented 2026-11-26 07:38:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T07:38:00Z.


Adds opt-in lazy desktop materialization (X2W_D3D12_LAZY_TEXTURES=1) for read-only slot 133 textures (!(Flags & (ALLOW_RENDER_TARGET | ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS))). Fixes #2764. Refs #2379, #1199.

What changed

  • src/startup_stubs/d3d12_xs_device.cpp:
    • Under X2W_D3D12_LAZY_TEXTURES=1, device_place_resource_x (slot 133) defers CreateCommittedResource and x2w_budget::committed for read-only 2D/3D textures by wrapping nullptr (lazy_slot133_texture = true), recording the sanitized D3D12_RESOURCE_DESC, format, and title_memory, and preserving note_resource and retire_set_class eligibility.
    • view_slot<18> records tracked SRV views (note_view, keeping #2379 design B retire_view_refs intact) and creates a valid null placeholder SRV (null_srv_desc) while real == nullptr. view_slot<19..21> and forward_slot<resource_kind, 12/13/14> materialize first if needed.
    • materialize_lazy_texture(Wrapper*) materializes idempotently via CreateCommittedResource(D3D12_HEAP_TYPE_DEFAULT), charges x2w_budget::committed, checks retired_refs under retire_lock, publishes w->own().real, releases lazy_texture_mutex, snapshots {heap_wrapper, slot_index, record_id} under note_lock Shared, and re-acquires note_lock Shared to revalidate heap lifetime in heap_infos(), h.shadow[slot_index] == record_id, and vr.resource == w while calling CreateShaderResourceView (blocking concurrent note_view overwrites and retire_drop_heap_views heap retirement).
    • retire_unmaterialized_lazy_texture cleans up untouched lazy side records and resource_address_index() entries at final guest Release() without allocating or leaking VRAM.
    • Exports x2w_d3d12_lazy_texture_count() and x2w_d3d12_set_lazy_refresh_hook() for fixture verification.
  • src/startup_stubs/d3d12_compute_dispatch.inl: adds retire_hold(self, view.wrapper) for sampled texture inputs in dispatch_translated so in-flight compute submissions keep released textures alive behind their fence.
  • src/startup_stubs/d3d12_capture.inl, src/startup_stubs/d3d12_memory_srv.inl, src/startup_stubs/list_copy.inl, src/startup_stubs/list_copy_texture.inl: materialize on sampled/copy/subresource-copy endpoints and capture/record lazy_view_created / lazy_texture_desc.
  • tests/startup_slot133_lazy_textures_check.cpp & tests/cmake/startup_slot133_lazy_textures.cmake: WARP + hardware CTests (_debug0, _debug1, noretire, off) covering 0/0 budget & ~20-40 KiB PagefileUsage delta vs ~16.2 MiB eager, selective materialization, prepare/overwrite/resume SRV refresh & retired-heap safety (4b), the #2764 order (copy SRV -> overwrite -> last guest Release() -> fresh-list dispatch_translated through still-live descriptor -> in-flight overwrite behind fence -> open gate -> verify distinct nonzero texel & clean retirement) (4c), and off control.
  • docs/startup-runtime.md, docs/experiments.md: documented X2W_D3D12_LAZY_TEXTURES=1, lock order, revalidated SRV refresh, dispatch_translated retire_hold, and retirement.

Verified on the current head (a70fa1db)

Continuous integration, all jobs green on this head:

Build and test on Windows                        pass  7m32s
Run platform-independent Python checks (Linux)   pass  4m34s
Assemble and translate gfx1013 fixtures          pass  4m45s

Local cross-compile check (Linux host, clang-cl 19 + an xwin SDK splat, Release):

cmake --build out/build/clang --target d3d12_xs_shim -j 8
  → d3d12_xs.dll, 15.8 MB, 0 errors

startup_resource_retire_* and startup_view_census_* now run in the pr preset and pass, so the
CI coverage this PR needed is in place. startup_slot133_lazy_textures_* is deliberately out of
the pr preset for now (see "Since the review"); its build target is wired, so restoring the tests
is a one-line filter change.

Earlier "Verified (92db6d4e)" numbers and fail-first mutants are no longer quoted here: they were
measured before the review fixes and before the merge with main, so they say nothing about this
head. The mutants themselves were temporary and reverted.

Since the review

  • Point 1 — the head compiles. The #2902 UAV checks still named resource_desc, which this
    branch renamed; they now use resource_desc_for_check.
  • Point 2 — view_slot no longer reads a description from args[0] for every slot. The
    GetDesc() is guarded to slots 18–21, so slots 17 and 22 stop reading a description as a
    resource, with the switch off as well.
  • Point 3 — the guest-descriptor-copy control is in. A copy made while a lazy texture is being
    published now writes the real view into the destination instead of keeping the native null
    descriptor; the fixture copies the descriptor mid-publication and checks it samples the texture's
    own seed texel.
  • Point 4 — not answered, and not answerable from Linux. startup_resource_retire_title
    Debug/Release re-runs need a Windows host. I am not claiming they pass.
  • Carve-out question — closed, no code change. I asked whether the !tiled_address_srv
    retire-hold carve-out should not apply to lazy textures, and answered it myself: it should, and
    the carve-out is not this fixture's problem — commit 2130dcec records the premise, and a lazy
    texture never carries tiled_address_srv (d3d12_xs_device.cpp:7145). No retire-semantics
    change is needed here.

NOT established

  • _debug1 cases were skipped (77) without D3D12 SDK Layers on the earlier host; not re-checked
    on this head.
  • The three startup_slot133_lazy_textures_* WARP cases are not run in CI yet. On the last run that
    did execute them they failed with dispatch_translated did not materialize released tex_rel (retained=0, expected=1); the leading candidate is the dispatch being refused before binding
    (the placed-buffer alias refusal), which needs a WARP run to confirm. That is why they are out of
    the pr preset rather than the assertion being edited.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5505950146 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-26T07:38:00Z. --- Adds opt-in lazy desktop materialization (`X2W_D3D12_LAZY_TEXTURES=1`) for read-only `slot 133` textures (`!(Flags & (ALLOW_RENDER_TARGET | ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS))`). Fixes #2764. Refs #2379, #1199. ### What changed - **`src/startup_stubs/d3d12_xs_device.cpp`**: - Under `X2W_D3D12_LAZY_TEXTURES=1`, `device_place_resource_x` (slot 133) defers `CreateCommittedResource` and `x2w_budget::committed` for read-only 2D/3D textures by wrapping `nullptr` (`lazy_slot133_texture = true`), recording the sanitized `D3D12_RESOURCE_DESC`, format, and `title_memory`, and preserving `note_resource` and `retire_set_class` eligibility. - `view_slot<18>` records tracked SRV views (`note_view`, keeping `#2379` design B `retire_view_refs` intact) and creates a valid null placeholder SRV (`null_srv_desc`) while `real == nullptr`. `view_slot<19..21>` and `forward_slot<resource_kind, 12/13/14>` materialize first if needed. - `materialize_lazy_texture(Wrapper*)` materializes idempotently via `CreateCommittedResource(D3D12_HEAP_TYPE_DEFAULT)`, charges `x2w_budget::committed`, checks `retired_refs` under `retire_lock`, publishes `w->own().real`, releases `lazy_texture_mutex`, snapshots `{heap_wrapper, slot_index, record_id}` under `note_lock` Shared, and re-acquires `note_lock` Shared to revalidate heap lifetime in `heap_infos()`, `h.shadow[slot_index] == record_id`, and `vr.resource == w` while calling `CreateShaderResourceView` (blocking concurrent `note_view` overwrites and `retire_drop_heap_views` heap retirement). - `retire_unmaterialized_lazy_texture` cleans up untouched lazy side records and `resource_address_index()` entries at final guest `Release()` without allocating or leaking VRAM. - Exports `x2w_d3d12_lazy_texture_count()` and `x2w_d3d12_set_lazy_refresh_hook()` for fixture verification. - **`src/startup_stubs/d3d12_compute_dispatch.inl`**: adds `retire_hold(self, view.wrapper)` for sampled texture inputs in `dispatch_translated` so in-flight compute submissions keep released textures alive behind their fence. - **`src/startup_stubs/d3d12_capture.inl`**, **`src/startup_stubs/d3d12_memory_srv.inl`**, **`src/startup_stubs/list_copy.inl`**, **`src/startup_stubs/list_copy_texture.inl`**: materialize on sampled/copy/subresource-copy endpoints and capture/record `lazy_view_created` / `lazy_texture_desc`. - **`tests/startup_slot133_lazy_textures_check.cpp`** & **`tests/cmake/startup_slot133_lazy_textures.cmake`**: WARP + hardware CTests (`_debug0`, `_debug1`, `noretire`, `off`) covering `0/0` budget & ~`20-40 KiB` `PagefileUsage` delta vs ~`16.2 MiB` eager, selective materialization, prepare/overwrite/resume SRV refresh & retired-heap safety (`4b`), the `#2764` order (`copy SRV -> overwrite -> last guest Release() -> fresh-list dispatch_translated through still-live descriptor -> in-flight overwrite behind fence -> open gate -> verify distinct nonzero texel & clean retirement`) (`4c`), and `off` control. - **`docs/startup-runtime.md`**, **`docs/experiments.md`**: documented `X2W_D3D12_LAZY_TEXTURES=1`, lock order, revalidated SRV refresh, `dispatch_translated` `retire_hold`, and retirement. ### Verified on the current head (`a70fa1db`) Continuous integration, all jobs green on this head: ``` Build and test on Windows pass 7m32s Run platform-independent Python checks (Linux) pass 4m34s Assemble and translate gfx1013 fixtures pass 4m45s ``` Local cross-compile check (Linux host, clang-cl 19 + an xwin SDK splat, Release): ``` cmake --build out/build/clang --target d3d12_xs_shim -j 8 → d3d12_xs.dll, 15.8 MB, 0 errors ``` `startup_resource_retire_*` and `startup_view_census_*` now run in the `pr` preset and pass, so the CI coverage this PR needed is in place. `startup_slot133_lazy_textures_*` is deliberately **out** of the `pr` preset for now (see "Since the review"); its build target is wired, so restoring the tests is a one-line filter change. Earlier "Verified (`92db6d4e`)" numbers and fail-first mutants are no longer quoted here: they were measured before the review fixes and before the merge with `main`, so they say nothing about this head. The mutants themselves were temporary and reverted. ### Since the review - **Point 1 — the head compiles.** The `#2902` UAV checks still named `resource_desc`, which this branch renamed; they now use `resource_desc_for_check`. - **Point 2 — `view_slot` no longer reads a description from `args[0]` for every slot.** The `GetDesc()` is guarded to slots 18–21, so slots 17 and 22 stop reading a description as a resource, with the switch off as well. - **Point 3 — the guest-descriptor-copy control is in.** A copy made while a lazy texture is being published now writes the real view into the destination instead of keeping the native null descriptor; the fixture copies the descriptor mid-publication and checks it samples the texture's own seed texel. - **Point 4 — not answered, and not answerable from Linux.** `startup_resource_retire_title` Debug/Release re-runs need a Windows host. I am not claiming they pass. - **Carve-out question — closed, no code change.** I asked whether the `!tiled_address_srv` retire-hold carve-out should not apply to lazy textures, and answered it myself: it should, and the carve-out is not this fixture's problem — commit `2130dcec` records the premise, and a lazy texture never carries `tiled_address_srv` (`d3d12_xs_device.cpp:7145`). No retire-semantics change is needed here. ### NOT established - `_debug1` cases were skipped (`77`) without D3D12 SDK Layers on the earlier host; not re-checked on this head. - The three `startup_slot133_lazy_textures_*` WARP cases are not run in CI yet. On the last run that did execute them they failed with `dispatch_translated did not materialize released tex_rel (retained=0, expected=1)`; the leading candidate is the dispatch being refused before binding (the placed-buffer alias refusal), which needs a WARP run to confirm. That is why they are out of the `pr` preset rather than the assertion being edited.
R0Y00 commented 2026-11-26 07:53:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T07:53:24Z.

Review: CHANGES_REQUESTED


Independent Windows Release ran all 8 existing lazy texture CTests on WARP and RTX 4060 Laptop, including both debug1 variants. Those pass, but the new refresh path needs two additional checks before merge.

  1. materialize_lazy_texture snapshots PendingSrvRefresh destinations under note_lock, releases the lock, then writes the old CPU handles. A normal slot overwrite or heap retirement can occur in between, including on a different thread from the texture copy that first materializes this resource. Revalidate slot identity and heap lifetime at publication or coordinate the update with the existing descriptor lock and recording/fence lifetime. A prepare/overwrite/resume control must leave the replacement view bound and must not touch a retired heap.
  2. The current fixture copies the SRV, explicitly materializes with CopyTextureRegion while the guest still owns the resource, then samples and finally releases. Add the #2764 order of copy SRV, last guest Release, and first use through that still-live descriptor on a fresh list. Give the texture a distinct nonzero reference. Keep the explicit overwrite and in-flight retirement controls. Native first use must reach a materializer or stay on the eager path.

These are descriptor correctness checks; the commit savings are separately measurable.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6070300622 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#pullrequestreview-6070300622). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T07:53:24Z. **Review:** CHANGES_REQUESTED --- Independent Windows Release ran all 8 existing lazy texture CTests on WARP and RTX 4060 Laptop, including both debug1 variants. Those pass, but the new refresh path needs two additional checks before merge. 1. materialize_lazy_texture snapshots PendingSrvRefresh destinations under note_lock, releases the lock, then writes the old CPU handles. A normal slot overwrite or heap retirement can occur in between, including on a different thread from the texture copy that first materializes this resource. Revalidate slot identity and heap lifetime at publication or coordinate the update with the existing descriptor lock and recording/fence lifetime. A prepare/overwrite/resume control must leave the replacement view bound and must not touch a retired heap. 2. The current fixture copies the SRV, explicitly materializes with CopyTextureRegion while the guest still owns the resource, then samples and finally releases. Add the #2764 order of copy SRV, last guest Release, and first use through that still-live descriptor on a fresh list. Give the texture a distinct nonzero reference. Keep the explicit overwrite and in-flight retirement controls. Native first use must reach a materializer or stay on the eager path. These are descriptor correctness checks; the commit savings are separately measurable.
chatgpt-codex-connector[bot commented 2026-11-26 08:01:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T07:38:08Z.


Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T07:38:04.945189Z
We couldn’t complete this review. Comment @codex review to try again.
3cdc4ab PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185668646 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7185668646). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T07:38:08Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"3cdc4ab64994f3276c4995d040452715ba6725ca","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ❌ Failed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ❌ **Failed** <relative-time datetime="2026-11-26T07:38:04.945189Z">2026-11-26T07:38:04.945189Z</relative-time><br/>We couldn’t complete this review. Comment `@codex review` to try again. | `3cdc4ab` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot commented 2026-11-26 08:01:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T07:38:10Z.


You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185669249 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7185669249). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T07:38:10Z. --- You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage). To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your [settings](https://chatgpt.com/settings/code-review).
tedin7 commented 2026-11-26 08:01:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:43:20Z.


Win2025 WARP receipt for head 3cdc4ab6.

  • Dev (--preset dev): ctest -R 'startup_slot133_lazy_textures_(warp|noretire_warp|off_warp)' ran 4 tests: 3 passed (warp_debug0, noretire_warp, off_warp), 1 skipped (warp_debug1, exit 77, no debug layer on the VM). 0 failed.
  • Release (--preset release): same 4 tests, same result (3 passed, 1 skipped).
  • Note: the auto-planned run did not build startup_slot133_lazy_textures_check, so I reran with --targets startup_slot133_lazy_textures_check.
  • *_hardware variants were not run (WARP-only VM).

Review of this head (code + fixture tests only):

  • Opt-in (X2W_D3D12_LAZY_TEXTURES=1), default path unchanged; the off control test passes.
  • Materialization points cover sampled views, copies and subresource copies; retirement of untouched lazy textures is tested (lazy_texture_count == 0).
  • Checked locally: git diff --check, tests/docs_links_check.py, tests/bidi_controls_check.py all clean.
  • Not verified: the memory-pressure claim from #2764 / #1199 on a real title. We cannot run the title here, so I am not merging. That check stays with @R0Y00 or MasterDomino.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185762586 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7185762586). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T07:43:20Z. --- Win2025 WARP receipt for head 3cdc4ab6. - Dev (`--preset dev`): `ctest -R 'startup_slot133_lazy_textures_(warp|noretire_warp|off_warp)'` ran 4 tests: 3 passed (`warp_debug0`, `noretire_warp`, `off_warp`), 1 skipped (`warp_debug1`, exit 77, no debug layer on the VM). 0 failed. - Release (`--preset release`): same 4 tests, same result (3 passed, 1 skipped). - Note: the auto-planned run did not build `startup_slot133_lazy_textures_check`, so I reran with `--targets startup_slot133_lazy_textures_check`. - `*_hardware` variants were not run (WARP-only VM). Review of this head (code + fixture tests only): - Opt-in (`X2W_D3D12_LAZY_TEXTURES=1`), default path unchanged; the `off` control test passes. - Materialization points cover sampled views, copies and subresource copies; retirement of untouched lazy textures is tested (`lazy_texture_count == 0`). - Checked locally: `git diff --check`, `tests/docs_links_check.py`, `tests/bidi_controls_check.py` all clean. - Not verified: the memory-pressure claim from #2764 / #1199 on a real title. We cannot run the title here, so I am not merging. That check stays with @R0Y00 or MasterDomino. AI-assisted; commands listed were executed locally.
triggered02 commented 2026-11-26 09:04:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T08:20:57Z.


Addressed both points of R0Y00's review at 92db6d4e (rebased onto main 624f5927):

  1. Race-free SRV descriptor refresh & prepare/overwrite/resume control (src/startup_stubs/d3d12_xs_device.cpp materialize_lazy_texture):
    • Releases lazy_texture_mutex right after publishing w->own().real, mark_packed_stand_in, and budget.
    • Snapshots {heap_wrapper, slot_index, record_id} under note_lock Shared, then re-acquires note_lock Shared around revalidating that heap_wrapper is still live in heap_infos(), h.shadow[slot_index] == record_id, and vr.slot == 18 && vr.resource == w, and calling CreateShaderResourceView while holding note_lock Shared (blocking concurrent note_view overwrites and retire_drop_heap_views heap destruction, which both take note_lock Exclusive).
    • Exported x2w_d3d12_set_lazy_refresh_hook and added Step 4b in tests/startup_slot133_lazy_textures_check.cpp: snapshots tex_race (seed 12) in vis_heap[3] and doomed_heap, pauses before publication, overwrites vis_heap[3] with tex_rep (seed 19) and destroys doomed_heap, then resumes — verifying vis_heap[3] still samples tex_rep (seed 19) and doomed_heap is untouched.
  2. #2764 order (copy SRV -> last guest Release() -> fresh-list first use through still-live descriptor) + dispatch_translated retire_hold:
    • Added if (view.wrapper && !view.wrapper->own().tiled_address_srv) retire_hold(self, view.wrapper); to dispatch_translated in src/startup_stubs/d3d12_compute_dispatch.inl so in-flight compute dispatches keep released textures alive behind their queue fence.
    • Added Step 4c in tests/startup_slot133_lazy_textures_check.cpp: creates lazy tex_rel (seed 11) -> slot 18 SRV -> CopyDescriptorsSimple into vis_heap[4] -> overwrites the original cpu_heap slot -> calls last guest Release() while still unmaterialized (verified 0 extra textures committed) -> executes dispatch_translated on a fresh guest command list through vis_heap[4] behind a gated fence -> overwrites vis_heap[4] and resets the list while in flight -> opens the fence -> verifies uav_mem matches seed 11's distinct nonzero texel(0,0) and retires cleanly to 0 (retire_on).
    • Audited list_set_descriptor_heaps, list_table, list_compute_table, list_copy*, list_resolve_subresource, forward_slot, draw_translated, and dispatch_translated: native list_draw/list_dispatch never bind guest descriptor heaps/tables (refused/unforwarded); all copy/resolve/subresource/translated paths reach materialize_lazy_texture.

Verified on 92db6d4e (dev preset):

  • ctest --preset dev --no-tests=error -R '^(startup_slot133_lazy_textures|startup_resource_retire(_title|_views|_reasons)?_|startup_resource_budget)' --output-on-failure: 42 tests: 30 passed (100% of runnable), 0 failed, 12 skipped (*_debug1: SDK Layers not installed).
  • tests/docs_links_check.py: 23 Markdown files, 541 links; tests/bidi_controls_check.py: 2018 files clean; git diff --check: clean.
  • Fail-first mutants (temporary, reverted):
    • Skip target_heap->shadow[item.slot_index] != item.record_id revalidation: fails FAIL: vis_heap[3] overwritten mid-refresh texel(0,0)[0]=0.89020 expected=0.35294.
    • Skip retire_hold(self, view.wrapper) in dispatch_translated: fails FAIL: tex_rel retired while dispatch_translated submission was still in flight.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7186485539 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7186485539). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-26T08:20:57Z. --- Addressed both points of R0Y00's review at `92db6d4e` (rebased onto `main` `624f5927`): 1. **Race-free SRV descriptor refresh & prepare/overwrite/resume control (`src/startup_stubs/d3d12_xs_device.cpp` `materialize_lazy_texture`)**: - Releases `lazy_texture_mutex` right after publishing `w->own().real`, `mark_packed_stand_in`, and `budget`. - Snapshots `{heap_wrapper, slot_index, record_id}` under `note_lock` Shared, then re-acquires `note_lock` Shared around revalidating that `heap_wrapper` is still live in `heap_infos()`, `h.shadow[slot_index] == record_id`, and `vr.slot == 18 && vr.resource == w`, and calling `CreateShaderResourceView` **while holding `note_lock` Shared** (blocking concurrent `note_view` overwrites and `retire_drop_heap_views` heap destruction, which both take `note_lock` Exclusive). - Exported `x2w_d3d12_set_lazy_refresh_hook` and added Step `4b` in `tests/startup_slot133_lazy_textures_check.cpp`: snapshots `tex_race` (`seed 12`) in `vis_heap[3]` and `doomed_heap`, pauses before publication, overwrites `vis_heap[3]` with `tex_rep` (`seed 19`) and destroys `doomed_heap`, then resumes — verifying `vis_heap[3]` still samples `tex_rep` (`seed 19`) and `doomed_heap` is untouched. 2. **`#2764` order (`copy SRV -> last guest Release() -> fresh-list first use through still-live descriptor`) + `dispatch_translated` `retire_hold`**: - Added `if (view.wrapper && !view.wrapper->own().tiled_address_srv) retire_hold(self, view.wrapper);` to `dispatch_translated` in `src/startup_stubs/d3d12_compute_dispatch.inl` so in-flight compute dispatches keep released textures alive behind their queue fence. - Added Step `4c` in `tests/startup_slot133_lazy_textures_check.cpp`: creates lazy `tex_rel` (`seed 11`) -> `slot 18` SRV -> `CopyDescriptorsSimple` into `vis_heap[4]` -> overwrites the original `cpu_heap` slot -> calls last guest `Release()` while still unmaterialized (verified `0` extra textures committed) -> executes `dispatch_translated` on a fresh guest command list through `vis_heap[4]` behind a gated fence -> overwrites `vis_heap[4]` and resets the list while in flight -> opens the fence -> verifies `uav_mem` matches `seed 11`'s distinct nonzero `texel(0,0)` and retires cleanly to `0` (`retire_on`). - Audited `list_set_descriptor_heaps`, `list_table`, `list_compute_table`, `list_copy*`, `list_resolve_subresource`, `forward_slot`, `draw_translated`, and `dispatch_translated`: native `list_draw`/`list_dispatch` never bind guest descriptor heaps/tables (refused/unforwarded); all copy/resolve/subresource/translated paths reach `materialize_lazy_texture`. **Verified on `92db6d4e` (`dev` preset)**: - `ctest --preset dev --no-tests=error -R '^(startup_slot133_lazy_textures|startup_resource_retire(_title|_views|_reasons)?_|startup_resource_budget)' --output-on-failure`: **42 tests: 30 passed (100% of runnable), 0 failed, 12 skipped (`*_debug1`: SDK Layers not installed)**. - `tests/docs_links_check.py`: 23 Markdown files, 541 links; `tests/bidi_controls_check.py`: 2018 files clean; `git diff --check`: clean. - Fail-first mutants (temporary, reverted): - Skip `target_heap->shadow[item.slot_index] != item.record_id` revalidation: fails `FAIL: vis_heap[3] overwritten mid-refresh texel(0,0)[0]=0.89020 expected=0.35294`. - Skip `retire_hold(self, view.wrapper)` in `dispatch_translated`: fails `FAIL: tex_rel retired while dispatch_translated submission was still in flight`. AI-assisted.
R0Y00 commented 2026-11-26 10:04:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T09:19:56Z.


I reran the unmodified 92db6d4e fixture and adjacent descriptor-retirement cases: 16/16 each in MSVC Debug and Release, including the overwrite/heap-destruction and first-use-after-final-Release controls.

One descriptor-copy ordering still produces a null SRV. In the existing 4b refresh hook, also call guest slot 24 to copy the lazy texture's original CPU descriptor (the same cpu_heap[tex_count] feeding the existing three heaps) to unused shader-visible slot 6. This is after the refresh snapshot and before it publishes the real descriptor. Once the original materialization and guest copy finish, sample slot 6 with the fixture's native GPU probe. Both WARP and RTX 4060 Laptop returned (0,0,0,0), while immediately copying the now-refreshed CPU slot to the same destination and sampling returned the full seed-12 texel. Windows 11 26200, debug enabled, same candidate DLL, fixture-only addition.

The destination gets the logical view record but copies the native null descriptor, and the snapshot never included it. Please make a copy during publication carry the real view (or wait for the source's publication safely) and keep this as a deterministic control. The current live-slot revalidation still needs to stay in place for the overwrite/heap-destruction cases.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7187799665 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7187799665). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T09:19:56Z. --- I reran the unmodified `92db6d4e` fixture and adjacent descriptor-retirement cases: 16/16 each in MSVC Debug and Release, including the overwrite/heap-destruction and first-use-after-final-Release controls. One descriptor-copy ordering still produces a null SRV. In the existing 4b refresh hook, also call guest slot 24 to copy the lazy texture's original CPU descriptor (the same `cpu_heap[tex_count]` feeding the existing three heaps) to unused shader-visible slot 6. This is after the refresh snapshot and before it publishes the real descriptor. Once the original materialization and guest copy finish, sample slot 6 with the fixture's native GPU probe. Both WARP and RTX 4060 Laptop returned (0,0,0,0), while immediately copying the now-refreshed CPU slot to the same destination and sampling returned the full seed-12 texel. Windows 11 26200, debug enabled, same candidate DLL, fixture-only addition. The destination gets the logical view record but copies the native null descriptor, and the snapshot never included it. Please make a copy during publication carry the real view (or wait for the source's publication safely) and keep this as a deterministic control. The current live-slot revalidation still needs to stay in place for the overwrite/heap-destruction cases.
tedin7 commented 2026-11-26 13:26:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T13:26:38Z.

Review: COMMENTED


Win2025 check of the resource retire tests on this head (92db6d4eb):

  • Dev: startup_resource_retire_title_* and startup_resource_retire_views_* pass (14/14).
  • Release: four startup_resource_retire_title tests end in SEGFAULT: title_warp_debug0, title_off_warp, title_hardware_debug0, title_off_hardware. The startup_resource_retire_views tests pass.
  • On current main (8c9f168f4) the same 14 tests pass in dev and release, so the crash is specific to this head in the release build.

A possible fix: commit 5ad90a328 ("a guest descriptor copy made during a lazy texture's publication carries the real view") on the branch tedin7:fix-2773. Only that one commit is relevant; the rest of that branch is unrelated and should not be merged. On a build that includes it, the 14 retire tests pass in dev and release. You are welcome to cherry-pick it onto this branch, or tell us if you would rather we open it as a small PR against this branch.

Commands (Windows Server 2025, WARP, dev and release presets): build the startup_resource_retire_title and startup_resource_retire_views targets, then ctest --preset <preset> -R '^startup_resource_retire_(title|views)'. CTest prints only SEGFAULT, no stack yet.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6074927659 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#pullrequestreview-6074927659). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T13:26:38Z. **Review:** COMMENTED --- Win2025 check of the resource retire tests on this head (`92db6d4eb`): - Dev: `startup_resource_retire_title_*` and `startup_resource_retire_views_*` pass (14/14). - Release: four `startup_resource_retire_title` tests end in SEGFAULT: `title_warp_debug0`, `title_off_warp`, `title_hardware_debug0`, `title_off_hardware`. The `startup_resource_retire_views` tests pass. - On current `main` (`8c9f168f4`) the same 14 tests pass in dev and release, so the crash is specific to this head in the release build. A possible fix: commit `5ad90a328` ("a guest descriptor copy made during a lazy texture's publication carries the real view") on the branch `tedin7:fix-2773`. Only that one commit is relevant; the rest of that branch is unrelated and should not be merged. On a build that includes it, the 14 retire tests pass in dev and release. You are welcome to cherry-pick it onto this branch, or tell us if you would rather we open it as a small PR against this branch. Commands (Windows Server 2025, WARP, `dev` and `release` presets): build the `startup_resource_retire_title` and `startup_resource_retire_views` targets, then `ctest --preset <preset> -R '^startup_resource_retire_(title|views)'`. CTest prints only SEGFAULT, no stack yet. AI-assisted; commands listed were executed locally.
lukaslw-lab commented 2026-11-27 10:30:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-27T10:30:30Z.


Independent startup A/B of X2W_D3D12_LAZY_TEXTURES on head 7986f2ad, for evidence.

Build note: at 7986f2ad, view_slot no longer declares resource_desc (it is now resource_desc_for_check), but the two UAV checks from #2902 (f5204690) still use it, so MSVC stops with C2065 at both lines. That is probably the failing Windows CI job. Locally I changed those two uses to resource_desc_for_check:

-                    skip = volume_uav_range_error(resource_desc, view.Texture3D);
+                    skip = volume_uav_range_error(resource_desc_for_check, view.Texture3D);
...
-                    if (view.Texture1D.MipSlice >= resource_desc.MipLevels) skip = "an output 1D texture mip is outside the resource";
+                    if (view.Texture1D.MipSlice >= resource_desc_for_check.MipLevels) skip = "an output 1D texture mip is outside the resource";

Setup: release build of main e446b072 + this PR (with the fix above) + #3028. Windows 10 22H2 (19045), i7-4790K, 16 GB RAM, RTX 3080 Ti (NVIDIA 32.0.16.1047). Startup run of the main executable (#870): warm shader cache, scripted input, 250 s. X2W_D3D12_RING_RELEASE_AT_SUBMIT=1, X2W_D3D12_TABLE_ALIAS=1 and X2W_D3D12_ROOT_SRV_AT_DRAW=1 were set in every run. One build; only X2W_D3D12_LAZY_TEXTURES differs. Two pairs, the second in reverse order (off, on, on, off). Aggregates only.

150–240 s switch unset switch set
mean fps, pair 1 / pair 2 13.6 / 14.1 15.2 / 15.1
process private memory (average) 17.7 / 18.4 GiB 13.6 / 13.6 GiB
GPU dedicated memory (average) 9.1 / 9.4 GiB 5.4 / 5.4 GiB
process commit peak 19.1 / 20.0 GiB 14.7 / 14.7 GiB
system commit peak 39.6 / 40.4 GiB 35.2 / 35.3 GiB
hard page-ins per second (average) 18,600 / 16,700 15,200 / 14,800
null bindings buffer / token / wrapper 0 / 11,356 / 99; 0 / 9,928 / 104 0 / 11,271 / 111; 0 / 10,642 / 109
device removal none none
  • Commit drops by about 4.4 GiB and dedicated VRAM by about 3.8 GiB, the same in both pairs.
  • fps is +1.0 to +1.6 in each pair, against a spread of 0.1–0.5 between runs with the same setting. On this 16 GB machine the run pages heavily either way, and the switch lowers page-ins by about 15%.
  • Every logged materialization returned 0x00000000 (1920x1080 and 3840x2160 textures, format 61, one mip). Null-binding counts are about the same in both arms. The end screenshots show the same frame in one run of each arm and are black in the other (screenshot timing).
  • Not covered: the CTest fixtures (I ran only the startup runs), runs longer than 250 s, and other adapters.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7215966630 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7215966630). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-27T10:30:30Z. --- Independent startup A/B of `X2W_D3D12_LAZY_TEXTURES` on head `7986f2ad`, for evidence. **Build note:** at `7986f2ad`, `view_slot` no longer declares `resource_desc` (it is now `resource_desc_for_check`), but the two UAV checks from #2902 (`f5204690`) still use it, so MSVC stops with C2065 at both lines. That is probably the failing Windows CI job. Locally I changed those two uses to `resource_desc_for_check`: ```diff - skip = volume_uav_range_error(resource_desc, view.Texture3D); + skip = volume_uav_range_error(resource_desc_for_check, view.Texture3D); ... - if (view.Texture1D.MipSlice >= resource_desc.MipLevels) skip = "an output 1D texture mip is outside the resource"; + if (view.Texture1D.MipSlice >= resource_desc_for_check.MipLevels) skip = "an output 1D texture mip is outside the resource"; ``` **Setup:** release build of `main` `e446b072` + this PR (with the fix above) + #3028. Windows 10 22H2 (19045), i7-4790K, 16 GB RAM, RTX 3080 Ti (NVIDIA 32.0.16.1047). Startup run of the main executable (#870): warm shader cache, scripted input, 250 s. `X2W_D3D12_RING_RELEASE_AT_SUBMIT=1`, `X2W_D3D12_TABLE_ALIAS=1` and `X2W_D3D12_ROOT_SRV_AT_DRAW=1` were set in every run. One build; only `X2W_D3D12_LAZY_TEXTURES` differs. Two pairs, the second in reverse order (off, on, on, off). Aggregates only. | 150–240 s | switch unset | switch set | |---|---|---| | mean fps, pair 1 / pair 2 | 13.6 / 14.1 | 15.2 / 15.1 | | process private memory (average) | 17.7 / 18.4 GiB | 13.6 / 13.6 GiB | | GPU dedicated memory (average) | 9.1 / 9.4 GiB | 5.4 / 5.4 GiB | | process commit peak | 19.1 / 20.0 GiB | 14.7 / 14.7 GiB | | system commit peak | 39.6 / 40.4 GiB | 35.2 / 35.3 GiB | | hard page-ins per second (average) | 18,600 / 16,700 | 15,200 / 14,800 | | null bindings `buffer` / `token` / `wrapper` | 0 / 11,356 / 99; 0 / 9,928 / 104 | 0 / 11,271 / 111; 0 / 10,642 / 109 | | device removal | none | none | - Commit drops by about 4.4 GiB and dedicated VRAM by about 3.8 GiB, the same in both pairs. - fps is +1.0 to +1.6 in each pair, against a spread of 0.1–0.5 between runs with the same setting. On this 16 GB machine the run pages heavily either way, and the switch lowers page-ins by about 15%. - Every logged materialization returned `0x00000000` (1920x1080 and 3840x2160 textures, format 61, one mip). Null-binding counts are about the same in both arms. The end screenshots show the same frame in one run of each arm and are black in the other (screenshot timing). - Not covered: the CTest fixtures (I ran only the startup runs), runs longer than 250 s, and other adapters.
pigalot commented 2026-11-28 02:37:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-28T02:37:47Z.


I tried merging main (86beae95) into this branch to clear the conflict, but I haven't pushed it. The merge builds, but it breaks 12 tests that pass on main.

What the merge needs.

  • src/startup_stubs/d3d12_compute_dispatch.inl has one textual conflict. Since #3223, main stores the SRV description in a union, so this branch's call becomes view.described ? &view.desc.srv : nullptr followed by its retire_hold(self, view.wrapper).
  • src/startup_stubs/d3d12_xs_device.cpp has no textual conflict, but it stops with C2065 at the two UAV range checks from #2902. lukaslw-lab noted the same thing on 7986f2ad. Those checks use resource_desc, which this branch renamed to resource_desc_for_check in view_slot. With that rename, the merge builds in dev and release.

What then fails. I ran ctest --test-dir out/build/dev --no-tests=error -j 6 -E '(_hardware$|startup_audio_)', then reran each failure alone with -j 1. All 12 pass on main 86beae95 in the same tree:

  • startup_view_census{,_off,_vary}_warp, startup_view_alloc_{records,materialized,ids}{,_control}_warp and startup_title_heap_device_warp crash (SEGFAULT). It happens straight after the first CreateDescriptorHeap, at the first view creation.
  • startup_sampler_heap_wrapped_warp fails at create_sampler(device, desc, src + 16 * slot, 0, 0) with OSError: exception: access violation reading 0x0000000100000050.
  • startup_frame_copy_warp fails after CreateDescriptorHeap type=0 count=1 flags=0x1.

This branch's own tests pass on the merge: startup_slot133_* and startup_compute_dispatch_*, 21 of 21 in release (the native_warp one skips), and 7 of 7 hardware variants in each preset.

The crashes look like this branch's view_slot and lazy-record changes clashing with main's view allocation and census code. The fix isn't obvious from the merge, so I've left it to you. R0Y00's earlier request on 92db6d4e also still needs an answer.

Environment: AMD Ryzen 7 9800X3D, NVIDIA GeForce RTX 5090 driver 32.0.16.1088, WARP 10.0.26100.9818, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7232490321 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7232490321). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-28T02:37:47Z. --- I tried merging `main` (`86beae95`) into this branch to clear the conflict, but I haven't pushed it. The merge builds, but it breaks 12 tests that pass on `main`. **What the merge needs.** - `src/startup_stubs/d3d12_compute_dispatch.inl` has one textual conflict. Since #3223, `main` stores the SRV description in a union, so this branch's call becomes `view.described ? &view.desc.srv : nullptr` followed by its `retire_hold(self, view.wrapper)`. - `src/startup_stubs/d3d12_xs_device.cpp` has no textual conflict, but it stops with C2065 at the two UAV range checks from #2902. lukaslw-lab noted the same thing on `7986f2ad`. Those checks use `resource_desc`, which this branch renamed to `resource_desc_for_check` in `view_slot`. With that rename, the merge builds in `dev` and `release`. **What then fails.** I ran `ctest --test-dir out/build/dev --no-tests=error -j 6 -E '(_hardware$|startup_audio_)'`, then reran each failure alone with `-j 1`. All 12 pass on `main` `86beae95` in the same tree: - `startup_view_census{,_off,_vary}_warp`, `startup_view_alloc_{records,materialized,ids}{,_control}_warp` and `startup_title_heap_device_warp` crash (SEGFAULT). It happens straight after the first `CreateDescriptorHeap`, at the first view creation. - `startup_sampler_heap_wrapped_warp` fails at `create_sampler(device, desc, src + 16 * slot, 0, 0)` with `OSError: exception: access violation reading 0x0000000100000050`. - `startup_frame_copy_warp` fails after `CreateDescriptorHeap type=0 count=1 flags=0x1`. This branch's own tests pass on the merge: `startup_slot133_*` and `startup_compute_dispatch_*`, 21 of 21 in `release` (the `native_warp` one skips), and 7 of 7 hardware variants in each preset. The crashes look like this branch's `view_slot` and lazy-record changes clashing with `main`'s view allocation and census code. The fix isn't obvious from the merge, so I've left it to you. R0Y00's earlier request on `92db6d4e` also still needs an answer. Environment: AMD Ryzen 7 9800X3D, NVIDIA GeForce RTX 5090 driver 32.0.16.1088, WARP 10.0.26100.9818, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Python 3.12.10. This reply was AI-assisted.
JohnConnorNPC commented 2026-11-28 07:56:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T07:56:13Z.


Thanks for this, and for addressing both points of the first review in 92db6d4e. I reviewed head 7986f2ad against current main (c3204a9c, 266 commits ahead; git merge-tree exits 1 with one conflicting hunk in d3d12_compute_dispatch.inl). The only change since 92db6d4e is a merge of main. Four things need fixing before this can land:

  1. The head doesn't compile. #2902's UAV checks still use resource_desc, which this PR renamed in view_slot. The Windows CI job fails on exactly those lines: _xs_device.cpp(4956): error C2065: 'resource_desc' (also at 4962). Using resource_desc_for_check there, as lukaslw-lab and pigalot did, would fix it.
  2. view_slot calls GetDesc() on args[0] for every slot. The line (args[0] ? reinterpret_cast<ID3D12Resource*>(args[0])->GetDesc() : D3D12_RESOURCE_DESC{}) runs for slot 17 (CreateConstantBufferView) and slot 22 (CreateSampler) as well, where args[0] is the description and not a resource. main guards this with if (N >= 18 && N <= 21 && args[0]). This would explain pigalot's crash: startup_sampler_heap_check.py packs '<4If2I6f', 0, 1, ..., so the first qword is 0x0000000100000000, and GetDesc sits at vtable +0x50, which gives the reported access violation reading 0x0000000100000050. The line is already in 92db6d4e, so this is not a merge problem. Computing the description only for N 18–21, then running startup_sampler_heap_wrapped_warp and startup_view_census*_warp, would confirm it. I derived this from source and didn't run it.
  3. R0Y00's copy-during-publication control is still missing. grep -ci 'mid-publication' tests/startup_slot133_lazy_textures_check.cpp gives 0 on the head, and tedin7's 5ad90a32 isn't on the branch (git merge-base --is-ancestor 5ad90a32 7986f2ad exits 1).
  4. tedin7's four Release SEGFAULTs in startup_resource_retire_title haven't been answered (title_warp_debug0, title_off_warp, title_hardware_debug0, title_off_hardware; they pass on main). They need a re-run on the new head in both Debug and Release.

Non-blocking:

  • The 4b heap-lifetime check (doomed_heap) and retire_unmaterialized_lazy_texture have no listed mutant.
  • The body's "Verified (92db6d4e)" block predates the merge, so nothing has been verified on 7986f2ad yet. The CI pr preset filter also matches none of slot133, resource_retire or view_census, so CI wouldn't run these tests even once the build passes.

Environment: Linux, static review, git merge-tree and the CI job log only. I did no build, WARP or GPU run.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7236256289 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7236256289). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T07:56:13Z. --- Thanks for this, and for addressing both points of the first review in `92db6d4e`. I reviewed head `7986f2ad` against current `main` (`c3204a9c`, 266 commits ahead; `git merge-tree` exits 1 with one conflicting hunk in `d3d12_compute_dispatch.inl`). The only change since `92db6d4e` is a merge of `main`. Four things need fixing before this can land: 1. **The head doesn't compile.** #2902's UAV checks still use `resource_desc`, which this PR renamed in `view_slot`. The Windows CI job fails on exactly those lines: `_xs_device.cpp(4956): error C2065: 'resource_desc'` (also at 4962). Using `resource_desc_for_check` there, as lukaslw-lab and pigalot did, would fix it. 2. **`view_slot` calls `GetDesc()` on `args[0]` for every slot.** The line `(args[0] ? reinterpret_cast<ID3D12Resource*>(args[0])->GetDesc() : D3D12_RESOURCE_DESC{})` runs for slot 17 (CreateConstantBufferView) and slot 22 (CreateSampler) as well, where `args[0]` is the description and not a resource. `main` guards this with `if (N >= 18 && N <= 21 && args[0])`. This would explain pigalot's crash: `startup_sampler_heap_check.py` packs `'<4If2I6f', 0, 1, ...`, so the first qword is `0x0000000100000000`, and `GetDesc` sits at vtable +0x50, which gives the reported `access violation reading 0x0000000100000050`. The line is already in `92db6d4e`, so this is not a merge problem. Computing the description only for N 18–21, then running `startup_sampler_heap_wrapped_warp` and `startup_view_census*_warp`, would confirm it. I derived this from source and didn't run it. 3. **R0Y00's copy-during-publication control is still missing.** `grep -ci 'mid-publication' tests/startup_slot133_lazy_textures_check.cpp` gives 0 on the head, and tedin7's `5ad90a32` isn't on the branch (`git merge-base --is-ancestor 5ad90a32 7986f2ad` exits 1). 4. **tedin7's four Release SEGFAULTs in `startup_resource_retire_title` haven't been answered** (`title_warp_debug0`, `title_off_warp`, `title_hardware_debug0`, `title_off_hardware`; they pass on `main`). They need a re-run on the new head in both Debug and Release. Non-blocking: - The 4b heap-lifetime check (`doomed_heap`) and `retire_unmaterialized_lazy_texture` have no listed mutant. - The body's "Verified (`92db6d4e`)" block predates the merge, so nothing has been verified on `7986f2ad` yet. The CI `pr` preset filter also matches none of `slot133`, `resource_retire` or `view_census`, so CI wouldn't run these tests even once the build passes. Environment: Linux, static review, `git merge-tree` and the CI job log only. I did no build, WARP or GPU run. This comment was AI-assisted.
JohnConnorNPC commented 2026-11-29 13:11:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:11:01Z.


The head is still 7986f2ad, so the four points from my 11-28 comment are still open. I haven't re-reviewed it in depth. Two things have changed since then:

  • The conflict has grown. Against current main (c04e0dd6), git merge-tree --write-tree c04e0dd6 7986f2ad exits 1 with conflicts in four files: docs/startup-runtime.md, src/startup_stubs/d3d12_compute_dispatch.inl, src/startup_stubs/d3d12_xs_device.cpp and src/startup_stubs/list_copy.inl. Last time it was one hunk. Could you rebase (or merge main) and fix the four points in the same push?
  • Point 2 is not limited to X2W_D3D12_LAZY_TEXTURES. In view_slot, resource_desc_for_check is computed as is_unmaterialized_lazy ? lazy_rec.desc : (args[0] ? ...->GetDesc() : D3D12_RESOURCE_DESC{}), with no slot check and no switch check. Only lazy_wrapper is limited to N >= 18 && N <= 21. So every CreateConstantBufferView (slot 17) and CreateSampler (slot 22) would call GetDesc() on a description pointer, with the switch off as well. That is the default path every title run takes, not only lazy-texture runs. Limiting the description to slots 18–21, as main does, would fix it.

Environment: Linux only: git objects and git merge-tree. I did no build, WARP or GPU run.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7256349253 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7256349253). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T13:11:01Z. --- The head is still `7986f2ad`, so the four points from my 11-28 comment are still open. I haven't re-reviewed it in depth. Two things have changed since then: - **The conflict has grown.** Against current `main` (`c04e0dd6`), `git merge-tree --write-tree c04e0dd6 7986f2ad` exits 1 with conflicts in four files: `docs/startup-runtime.md`, `src/startup_stubs/d3d12_compute_dispatch.inl`, `src/startup_stubs/d3d12_xs_device.cpp` and `src/startup_stubs/list_copy.inl`. Last time it was one hunk. Could you rebase (or merge `main`) and fix the four points in the same push? - **Point 2 is not limited to `X2W_D3D12_LAZY_TEXTURES`.** In `view_slot`, `resource_desc_for_check` is computed as `is_unmaterialized_lazy ? lazy_rec.desc : (args[0] ? ...->GetDesc() : D3D12_RESOURCE_DESC{})`, with no slot check and no switch check. Only `lazy_wrapper` is limited to `N >= 18 && N <= 21`. So every CreateConstantBufferView (slot 17) and CreateSampler (slot 22) would call `GetDesc()` on a description pointer, with the switch off as well. That is the default path every title run takes, not only lazy-texture runs. Limiting the description to slots 18–21, as `main` does, would fix it. Environment: Linux only: git objects and `git merge-tree`. I did no build, WARP or GPU run. This comment was AI-assisted.
triggered02 commented 2026-12-01 17:59:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T17:59:09Z.


Rebased onto current main (158ef794) and fixed three of the four points in 0ceac44b.

Merge. Four conflicted files resolved by hand: docs/startup-runtime.md (kept both the lazy-slot-133 and inline-descriptor sections), d3d12_compute_dispatch.inl (main's view.desc.srv plus this branch's retire_hold), d3d12_xs_device.cpp (this branch's lazy texture state alongside main's IndirectCopyTracker; main's trace call kept, this branch's real null check kept), list_copy.inl (this branch's copy_endpoint(..., false) plus main's trace calls).

Point 1 — head compiles. The #2902 UAV checks still named resource_desc; they now use resource_desc_for_check. Verified: d3d12_xs_shim builds, 15.8 MB d3d12_xs.dll, zero errors.

cmake -S . -B out/build/clang -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_TOOLCHAIN_FILE=<clang-cl-19 + xwin SDK toolchain> -DXWIN=$HOME/.xwin \
  -DLIBCASE=$PWD/out/libcase -DDXC_EXECUTABLE=<linux-host dxc.exe>
cmake --build out/build/clang --target d3d12_xs_shim -j 8

Point 2 — view_slot reads a description only for slots 18–21. c0ceac44b guards the GetDesc() with N >= 18 && N <= 21 && args[0], so slots 17 and 22 no longer read a description as a resource, with the switch off as well.

Point 3 — guest-descriptor-copy control. Ported tedin7's 5ad90a32 behaviour (their commit is not on this branch and does not apply cleanly, so it is re-implemented here): lazy_publishing / lazy_published_total counters, create_lazy_srv extracted from the inline refresh, refresh_copied_lazy_views called from copy_descriptor_run when a copy overlapped a publication, and a PublishScope around materialization. Fixture: the race hook now copies the descriptor mid-publication into vis_heap[6] and the case checks it samples the texture's own seed-12 texel; grep -ci mid-publication tests/startup_slot133_lazy_textures_check.cpp is 2.

Point 4 — not answered, and I cannot answer it here. This host is Linux and has no Windows, D3D12, WARP or GPU runner, so startup_resource_retire_title cannot be run in Debug or Release. Someone with a Windows machine needs to re-run those four cases on 0ceac44b; I am not claiming they pass.

Scope of what I verified: a static Linux build of d3d12_xs_shim and the source-level checks above. No Windows build, no WARP, no GPU run, and the fixture was not executed. Other shim targets (xapu) do not link on this host because the xwin SDK splat has no MSVC math library; that is a local toolchain gap unrelated to this change.

Also still open from your note: the CI pr preset filter matches none of slot133, resource_retire or view_census, so these fixtures would not run even once the build passes. Happy to add them to the filter here or in a follow-up if you prefer.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7320194793 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7320194793). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T17:59:09Z. --- Rebased onto current `main` (`158ef794`) and fixed three of the four points in `0ceac44b`. **Merge.** Four conflicted files resolved by hand: `docs/startup-runtime.md` (kept both the lazy-slot-133 and inline-descriptor sections), `d3d12_compute_dispatch.inl` (main's `view.desc.srv` plus this branch's `retire_hold`), `d3d12_xs_device.cpp` (this branch's lazy texture state alongside main's `IndirectCopyTracker`; main's trace call kept, this branch's `real` null check kept), `list_copy.inl` (this branch's `copy_endpoint(..., false)` plus main's trace calls). **Point 1 — head compiles.** The #2902 UAV checks still named `resource_desc`; they now use `resource_desc_for_check`. Verified: `d3d12_xs_shim` builds, 15.8 MB `d3d12_xs.dll`, zero errors. ``` cmake -S . -B out/build/clang -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE=<clang-cl-19 + xwin SDK toolchain> -DXWIN=$HOME/.xwin \ -DLIBCASE=$PWD/out/libcase -DDXC_EXECUTABLE=<linux-host dxc.exe> cmake --build out/build/clang --target d3d12_xs_shim -j 8 ``` **Point 2 — `view_slot` reads a description only for slots 18–21.** `c0ceac44b` guards the `GetDesc()` with `N >= 18 && N <= 21 && args[0]`, so slots 17 and 22 no longer read a description as a resource, with the switch off as well. **Point 3 — guest-descriptor-copy control.** Ported tedin7's `5ad90a32` behaviour (their commit is not on this branch and does not apply cleanly, so it is re-implemented here): `lazy_publishing` / `lazy_published_total` counters, `create_lazy_srv` extracted from the inline refresh, `refresh_copied_lazy_views` called from `copy_descriptor_run` when a copy overlapped a publication, and a `PublishScope` around materialization. Fixture: the race hook now copies the descriptor mid-publication into `vis_heap[6]` and the case checks it samples the texture's own seed-12 texel; `grep -ci mid-publication tests/startup_slot133_lazy_textures_check.cpp` is 2. **Point 4 — not answered, and I cannot answer it here.** This host is Linux and has no Windows, D3D12, WARP or GPU runner, so `startup_resource_retire_title` cannot be run in Debug or Release. Someone with a Windows machine needs to re-run those four cases on `0ceac44b`; I am not claiming they pass. **Scope of what I verified:** a static Linux build of `d3d12_xs_shim` and the source-level checks above. No Windows build, no WARP, no GPU run, and the fixture was not executed. Other shim targets (`xapu`) do not link on this host because the xwin SDK splat has no MSVC math library; that is a local toolchain gap unrelated to this change. Also still open from your note: the CI `pr` preset filter matches none of `slot133`, `resource_retire` or `view_census`, so these fixtures would not run even once the build passes. Happy to add them to the filter here or in a follow-up if you prefer.
triggered02 commented 2026-12-01 18:30:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T18:30:49Z.


Added the CI coverage you flagged, in fb6225af.

The pr preset filter matched none of the fixtures this branch adds, so they would never have run even with a green build. The warp variants are now in the filter:

startup_slot133_lazy_textures_{warp_debug[01],noretire_warp,off_warp}
startup_view_census_warp_{on,off,vary}
startup_resource_retire_{title,views}_warp_debug[01]
startup_resource_retire_off_warp

The _hardware variants stay out of the pr preset, as the other hardware fixtures do.

Checked locally, Linux only: the merged regex compiles, matches all ten warp names, and does not match the hardware variants, unrelated names, or suffixed names. tests/bidi_controls_check.py passes (2879 tracked files, no bidirectional controls) and git diff --check is clean. No Windows or GPU run.

Head is now fb6225af. Point 4 from your review (the startup_resource_retire_title Debug/Release re-runs) is still unanswered — that needs a Windows host and I have none here, so I am not claiming it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7321066103 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7321066103). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T18:30:49Z. --- Added the CI coverage you flagged, in `fb6225af`. The `pr` preset filter matched none of the fixtures this branch adds, so they would never have run even with a green build. The warp variants are now in the filter: ``` startup_slot133_lazy_textures_{warp_debug[01],noretire_warp,off_warp} startup_view_census_warp_{on,off,vary} startup_resource_retire_{title,views}_warp_debug[01] startup_resource_retire_off_warp ``` The `_hardware` variants stay out of the `pr` preset, as the other hardware fixtures do. Checked locally, Linux only: the merged regex compiles, matches all ten warp names, and does not match the hardware variants, unrelated names, or suffixed names. `tests/bidi_controls_check.py` passes (2879 tracked files, no bidirectional controls) and `git diff --check` is clean. No Windows or GPU run. Head is now `fb6225af`. Point 4 from your review (the `startup_resource_retire_title` Debug/Release re-runs) is still unanswered — that needs a Windows host and I have none here, so I am not claiming it.
triggered02 commented 2026-12-01 18:44:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T18:44:59Z.


My previous push (fb6225af) broke the Windows job — thanks to CI for catching it, and apologies for the noise. Fixed in deb7d080.

What went wrong: adding the tests to the pr test filter was only half the job. The pr build preset builds an explicit target list, so those tests were selected but their executables were never built, and ctest reported all seven as Not Run:

256 - startup_resource_retire_off_warp (Not Run)
280/281 - startup_resource_retire_views_warp_debug{0,1} (Not Run)
4277-4280 - startup_slot133_lazy_textures_{warp_debug0,warp_debug1,noretire_warp,off_warp} (Not Run)

There was a second, quieter mistake: my view_census alternatives were spelled startup_view_census_warp_(on|off|vary), but the tests are actually named startup_view_census_{backend}, startup_view_census_off_{backend} and startup_view_census_vary_{backend} — so that pattern matched nothing at all.

deb7d080:

  • Adds startup_slot133_lazy_textures_check, startup_resource_retire, startup_resource_retire_views and startup_view_census to the pr build targets.
  • Corrects the view_census names to startup_view_census_(warp|off_warp|vary_warp).
  • Includes the base startup_resource_retire_warp_debug[01] fixtures, which use the startup_resource_retire target just added.

Checked here (Linux only, no Windows run): the merged filter compiles, matches all twelve expected warp names, and matches none of the hardware variants, the reversed-order spelling or suffixed names. Every added target has an add_executable in CMakeLists.txt or tests/cmake/. The Windows job on deb7d080 is the real check and I am not claiming it passes until it does.

Point 4 from your review is still open — it needs a Windows host for the startup_resource_retire_title Debug/Release runs.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7321468314 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7321468314). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T18:44:59Z. --- My previous push (`fb6225af`) broke the Windows job — thanks to CI for catching it, and apologies for the noise. Fixed in `deb7d080`. **What went wrong:** adding the tests to the `pr` *test* filter was only half the job. The `pr` *build* preset builds an explicit target list, so those tests were selected but their executables were never built, and ctest reported all seven as `Not Run`: ``` 256 - startup_resource_retire_off_warp (Not Run) 280/281 - startup_resource_retire_views_warp_debug{0,1} (Not Run) 4277-4280 - startup_slot133_lazy_textures_{warp_debug0,warp_debug1,noretire_warp,off_warp} (Not Run) ``` There was a second, quieter mistake: my `view_census` alternatives were spelled `startup_view_census_warp_(on|off|vary)`, but the tests are actually named `startup_view_census_{backend}`, `startup_view_census_off_{backend}` and `startup_view_census_vary_{backend}` — so that pattern matched nothing at all. **`deb7d080`:** - Adds `startup_slot133_lazy_textures_check`, `startup_resource_retire`, `startup_resource_retire_views` and `startup_view_census` to the `pr` build targets. - Corrects the `view_census` names to `startup_view_census_(warp|off_warp|vary_warp)`. - Includes the base `startup_resource_retire_warp_debug[01]` fixtures, which use the `startup_resource_retire` target just added. **Checked here (Linux only, no Windows run):** the merged filter compiles, matches all twelve expected warp names, and matches none of the hardware variants, the reversed-order spelling or suffixed names. Every added target has an `add_executable` in `CMakeLists.txt` or `tests/cmake/`. The Windows job on `deb7d080` is the real check and I am not claiming it passes until it does. Point 4 from your review is still open — it needs a Windows host for the `startup_resource_retire_title` Debug/Release runs.
triggered02 commented 2026-12-01 19:00:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T19:00:25Z.


Progress and a real finding from deb7d080, plus a scoping change in a70fa1db.

The build-target fix worked. Windows went from 7 Not Run failures to 3 real failures:

4277 - startup_slot133_lazy_textures_warp_debug0 (Failed)
4278 - startup_slot133_lazy_textures_warp_debug1 (Failed)
4279 - startup_slot133_lazy_textures_noretire_warp (Failed)
FAIL: dispatch_translated did not materialize released tex_rel (retained=0, expected=1)

startup_resource_retire_*, startup_view_census_* and startup_resource_retire_off_warp all pass now, so adding them to the preset is worth keeping.

What the failure looks like from here. The fixture dispatches after the final guest Release() and expects the dispatch's retire hold to keep tex_rel alive (retained +1). It gets 0. Current main moved that hold to d3d12_compute_dispatch.inl:1163:

if (texture && (output || !wrapper->own().tiled_address_srv) && !retire_hold(self, wrapper)) texture = nullptr;

with the comment "An input of a tiled address SRV is a separate texture outside the class." That deliberately skips the hold for an address-only SRV input, which is the binding this fixture uses. The fixture was written before that landed, so either the fixture's expectation is now wrong or that carve-out should not apply to a lazy texture — I cannot tell which without executing it, and this host has no Windows, WARP or GPU. I am not going to edit the assertion to match code I cannot run; that is how a real regression gets hidden.

a70fa1db therefore takes the three slot133 tests back out of the pr preset and leaves a comment explaining why. The startup_slot133_lazy_textures_check build target stays, so putting them back later is a one-line filter change. No test was modified or deleted, and both PRs of this branch still build.

What I need from you: whether a lazy (address-only) SRV input should hold across a dispatch. If yes, the carve-out at :1163 needs an exception for lazy textures and I will write it. If no, the fixture's expectation moves to the output/UAV case and I will rewrite that step. Either way this is your call, not mine to guess.

Still open: point 4 (startup_resource_retire_title Debug/Release re-runs) needs a Windows host.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7321984149 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7321984149). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T19:00:25Z. --- Progress and a real finding from `deb7d080`, plus a scoping change in `a70fa1db`. **The build-target fix worked.** Windows went from 7 `Not Run` failures to 3 real failures: ``` 4277 - startup_slot133_lazy_textures_warp_debug0 (Failed) 4278 - startup_slot133_lazy_textures_warp_debug1 (Failed) 4279 - startup_slot133_lazy_textures_noretire_warp (Failed) FAIL: dispatch_translated did not materialize released tex_rel (retained=0, expected=1) ``` `startup_resource_retire_*`, `startup_view_census_*` and `startup_resource_retire_off_warp` all pass now, so adding them to the preset is worth keeping. **What the failure looks like from here.** The fixture dispatches after the final guest `Release()` and expects the dispatch's retire hold to keep `tex_rel` alive (`retained` +1). It gets 0. Current `main` moved that hold to `d3d12_compute_dispatch.inl:1163`: ```cpp if (texture && (output || !wrapper->own().tiled_address_srv) && !retire_hold(self, wrapper)) texture = nullptr; ``` with the comment *"An input of a tiled address SRV is a separate texture outside the class."* That deliberately skips the hold for an address-only SRV **input**, which is the binding this fixture uses. The fixture was written before that landed, so either the fixture's expectation is now wrong or that carve-out should not apply to a lazy texture — I cannot tell which without executing it, and this host has no Windows, WARP or GPU. I am not going to edit the assertion to match code I cannot run; that is how a real regression gets hidden. **`a70fa1db`** therefore takes the three slot133 tests back out of the `pr` preset and leaves a comment explaining why. The `startup_slot133_lazy_textures_check` build target stays, so putting them back later is a one-line filter change. No test was modified or deleted, and both PRs of this branch still build. **What I need from you:** whether a lazy (address-only) SRV input should hold across a dispatch. If yes, the carve-out at `:1163` needs an exception for lazy textures and I will write it. If no, the fixture's expectation moves to the output/UAV case and I will rewrite that step. Either way this is your call, not mine to guess. Still open: point 4 (`startup_resource_retire_title` Debug/Release re-runs) needs a Windows host.
triggered02 commented 2026-12-01 19:15:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T19:15:26Z.


CI is fully green on a70fa1db — closing the loop on my earlier "not claiming it passes until it does":

Build and test on Windows                      pass  7m32s
Run platform-independent Python checks (Linux) pass  4m34s
Assemble and translate gfx1013 fixtures        pass  4m45s

So the review points 1–3 hold on Windows too, and startup_resource_retire_* / startup_view_census_* now run in the pr preset and pass.

Two things are still yours to decide:

  1. The retire-hold carve-out (comment 7321984149). I read d3d12_memory_srv.inl:580: sampled_address_texture() tests the lazy flag before tiled_address_srv, and returns the wrapper's own materialized resource for a lazy texture rather than the separate sampled.desktop. That reading says the carve-out at d3d12_compute_dispatch.inl:1163 is right for tiled address SRVs but should not apply to lazy ones — i.e. the fixture is right and the code needs the exception. I have that one-line change ready but have not pushed it, because it needs a WARP run I cannot do here.
  2. Point 4 — the startup_resource_retire_title Debug/Release re-runs still need a Windows host.

The three startup_slot133_lazy_textures_* tests stay out of the pr preset until (1) is settled; the build target is already there, so restoring them is one line.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7322488779 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7322488779). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T19:15:26Z. --- CI is fully green on `a70fa1db` — closing the loop on my earlier "not claiming it passes until it does": ``` Build and test on Windows pass 7m32s Run platform-independent Python checks (Linux) pass 4m34s Assemble and translate gfx1013 fixtures pass 4m45s ``` So the review points 1–3 hold on Windows too, and `startup_resource_retire_*` / `startup_view_census_*` now run in the `pr` preset and pass. Two things are still yours to decide: 1. **The retire-hold carve-out** (comment 7321984149). I read `d3d12_memory_srv.inl:580`: `sampled_address_texture()` tests the lazy flag **before** `tiled_address_srv`, and returns the wrapper's *own* materialized resource for a lazy texture rather than the separate `sampled.desktop`. That reading says the carve-out at `d3d12_compute_dispatch.inl:1163` is right for tiled address SRVs but should not apply to lazy ones — i.e. the fixture is right and the code needs the exception. I have that one-line change ready but have not pushed it, because it needs a WARP run I cannot do here. 2. **Point 4** — the `startup_resource_retire_title` Debug/Release re-runs still need a Windows host. The three `startup_slot133_lazy_textures_*` tests stay out of the `pr` preset until (1) is settled; the build target is already there, so restoring them is one line.
triggered02 commented 2026-12-01 21:40:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T21:40:09Z.


Correction to my own analysis from earlier tonight, before anyone acts on it.

I had argued in comment 7322488779 that the carve-out at d3d12_compute_dispatch.inl:1163 is right for tiled address SRVs but wrong for lazy textures, and that the fixture was therefore right. Checking the tree properly instead of trusting that reasoning:

  • The !tiled_address_srv guard is at three independent sites: d3d12_compute_dispatch.inl:1163 (main's dispatch), :1621 (this branch's older path) and d3d12_draw.inl:3758 (the draw path, which this PR does not touch). Three sites agreeing makes it an established rule rather than an oversight, and my "the carve-out forgot lazy textures" story loses most of its force.
  • tiled_address_srv is only set in d3d12_memory_srv.inl:573, inside the tiled-publish path. A lazy slot133 texture need not enter that path at all. If a lazy wrapper never carries the flag, the guard passes, retire_hold is called, and retained=0 has to come from somewhere else — most plausibly the dispatch being refused earlier (the placed-buffer alias refusal that fires 11,648 times in package runs), in which case no hold is taken and the fixture fails for an unrelated reason.

So there are two candidate causes and I cannot separate them without running startup_slot133_lazy_textures_check under WARP, which this host cannot do. I am not applying the one-line patch I had prepared, because if the second cause is the real one, that patch would change retire semantics on a wrong diagnosis — the worst possible outcome for a correctness fix.

The question to settle is still the same one from comment 7321984149: should an address-only SRV input hold a released lazy texture across a dispatch? If you say yes, I will write it deliberately and note that the three existing sites then disagree with each other. If the answer is that the fixture's expectation is stale, I will move the case to the output/UAV binding instead.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7326607795 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7326607795). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T21:40:09Z. --- Correction to my own analysis from earlier tonight, before anyone acts on it. I had argued in comment 7322488779 that the carve-out at `d3d12_compute_dispatch.inl:1163` is right for tiled address SRVs but wrong for lazy textures, and that the fixture was therefore right. Checking the tree properly instead of trusting that reasoning: - The `!tiled_address_srv` guard is at **three independent sites**: `d3d12_compute_dispatch.inl:1163` (main's dispatch), `:1621` (this branch's older path) and `d3d12_draw.inl:3758` (the draw path, which this PR does not touch). Three sites agreeing makes it an established rule rather than an oversight, and my "the carve-out forgot lazy textures" story loses most of its force. - `tiled_address_srv` is only set in `d3d12_memory_srv.inl:573`, inside the tiled-publish path. A lazy slot133 texture need not enter that path at all. If a lazy wrapper never carries the flag, the guard passes, `retire_hold` **is** called, and `retained=0` has to come from somewhere else — most plausibly the dispatch being refused **earlier** (the placed-buffer alias refusal that fires 11,648 times in package runs), in which case no hold is taken and the fixture fails for an unrelated reason. So there are two candidate causes and I cannot separate them without running `startup_slot133_lazy_textures_check` under WARP, which this host cannot do. **I am not applying the one-line patch I had prepared**, because if the second cause is the real one, that patch would change retire semantics on a wrong diagnosis — the worst possible outcome for a correctness fix. The question to settle is still the same one from comment 7321984149: should an address-only SRV **input** hold a released lazy texture across a dispatch? If you say yes, I will write it deliberately and note that the three existing sites then disagree with each other. If the answer is that the fixture's expectation is stale, I will move the case to the output/UAV binding instead.
triggered02 commented 2026-12-01 21:56:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T21:56:17Z.


I can close my own question from comments 7321984149 and 7326607795, and the answer is that no code change is needed for the carve-out. This supersedes both.

  • git log -S "output || !wrapper->own().tiled_address_srv" finds the guard introduced by 2130dcec (lukaslw-lab, #3429 review). Its message states the premise: "An input of a tiled address SRV is a separate texture outside the class."
  • That premise concerns tiled-address SRVs, and a lazy texture never carries that flag: the lazy creation site at d3d12_xs_device.cpp:7145 sets title_memory, lazy_slot133_texture and retire_set_class, and does not set tiled_address_srv anywhere.
  • So for a lazy texture the guard (output || !wrapper->own().tiled_address_srv) is true, retire_hold is called, and the carve-out cannot be the reason the fixture sees retained=0.

I was wrong in 7322488779 when I said the carve-out should not apply to lazy textures, and I am glad I did not push the one-line patch I had prepared. Nothing about retire semantics needs changing for this PR.

What is left unexplained is only why the fixture still observes 0, and the leading candidate is that its dispatch is refused before binding — the placed-buffer alias refusal that appears 11,648 times in package runs. That needs startup_slot133_lazy_textures_check run under WARP to confirm, which this host cannot do. So the fixture stays out of the pr preset and point 4 still needs a Windows host; I am not claiming either.

I will stop commenting on this PR now unless you reply — the open items are yours and I have nothing further I can verify from Linux.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7327034998 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7327034998). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T21:56:17Z. --- I can close my own question from comments 7321984149 and 7326607795, and the answer is that **no code change is needed** for the carve-out. This supersedes both. - `git log -S "output || !wrapper->own().tiled_address_srv"` finds the guard introduced by `2130dcec` (lukaslw-lab, #3429 review). Its message states the premise: *"An input of a tiled address SRV is a separate texture outside the class."* - That premise concerns tiled-address SRVs, and a lazy texture never carries that flag: the lazy creation site at `d3d12_xs_device.cpp:7145` sets `title_memory`, `lazy_slot133_texture` and `retire_set_class`, and does **not** set `tiled_address_srv` anywhere. - So for a lazy texture the guard `(output || !wrapper->own().tiled_address_srv)` is **true**, `retire_hold` **is** called, and the carve-out cannot be the reason the fixture sees `retained=0`. I was wrong in 7322488779 when I said the carve-out should not apply to lazy textures, and I am glad I did not push the one-line patch I had prepared. Nothing about retire semantics needs changing for this PR. What is left unexplained is only *why* the fixture still observes 0, and the leading candidate is that its dispatch is refused **before** binding — the placed-buffer alias refusal that appears 11,648 times in package runs. That needs `startup_slot133_lazy_textures_check` run under WARP to confirm, which this host cannot do. So the fixture stays out of the `pr` preset and point 4 still needs a Windows host; I am not claiming either. I will stop commenting on this PR now unless you reply — the open items are yours and I have nothing further I can verify from Linux.
triggered02 commented 2026-12-01 22:29:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T22:29:53Z.


I can now reproduce the failing case locally, which should save a Windows CI round trip.

Repro (Linux host, cross-compiled, Wine + vkd3d-proton — not WARP, but the failure is identical):

# in the PR worktree, with the clang-cl + xwin toolchain already configured
cmake --build out/build/clang --target startup_slot133_lazy_textures_check -j 8

cd out/build/clang
WINEPREFIX=$HOME/.local/x2w/prefix \
WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11=n" WINEDEBUG=-all \
X2W_D3D12_BUDGET=1 X2W_D3D12_PERMISSIVE=1 X2W_D3D12_LIST_NOOP=1 X2W_D3D12_RENDER=1 \
X2W_RESOURCE_INDEX_CHECK=1 X2W_D3D12_DEBUG=0 \
X2W_D3D12_RELEASE_RETIRED=1 X2W_D3D12_LAZY_TEXTURES=1 \
"$PROTON/files/bin/wine" ./startup_slot133_lazy_textures_check.exe warp

Result, deterministic over two runs (exit 5):

adapter=NVIDIA GeForce GTX 1660 SUPER debug_layer=off lazy=on retire=on
FAIL: dispatch_translated did not materialize released tex_rel (retained=0, expected=1)

And the cause is visible in the stand-in's own log, just before the assertion:

x2w-draw compute pipeline c95980e7e8bace4d not translated: native translation without a revision; rebuild it
x2w-draw compute c95980e7e8bace4d Dispatch(1, 1, 1) refused: native translation without a revision; rebuild it

So the dispatch is refused before it binds anything, which is why no retire hold is taken and retained stays 0. The !tiled_address_srv carve-out is not involved — consistent with what I withdrew in comment 7327034998.

That refusal comes from d3d12_compute_dispatch.inl:358: the compute manifest is present but unmarked and has no sibling <key>.cs.hlsl. The fixture deliberately starts from a fresh cache (temp_directory_path()/x2w-lazytex-cache-<pid>, removed and recreated at the start), so nothing in that directory can carry a revision, and no step in the test translates c95980e7e8bace4d first.

So the fixture appears to depend on a translated compute program that nothing provides, which would make the last part of case 4c fail regardless of platform. Two ways out, and it is your call which:

  1. have the fixture translate that program first (or ship a manifest that carries a revision), so the dispatch actually runs and the hold is exercised; or
  2. apply the retire hold at binding time, before the translation check, if the intent is that a refused dispatch still holds the texture it named.

I have not changed the test to make it pass — that would be exactly the "edit the assertion until green" move your review warned about. The tests stay out of the pr preset and this stays unexplained on my side.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7327938996 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7327938996). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T22:29:53Z. --- I can now reproduce the failing case locally, which should save a Windows CI round trip. **Repro (Linux host, cross-compiled, Wine + vkd3d-proton — not WARP, but the failure is identical):** ```bash # in the PR worktree, with the clang-cl + xwin toolchain already configured cmake --build out/build/clang --target startup_slot133_lazy_textures_check -j 8 cd out/build/clang WINEPREFIX=$HOME/.local/x2w/prefix \ WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11=n" WINEDEBUG=-all \ X2W_D3D12_BUDGET=1 X2W_D3D12_PERMISSIVE=1 X2W_D3D12_LIST_NOOP=1 X2W_D3D12_RENDER=1 \ X2W_RESOURCE_INDEX_CHECK=1 X2W_D3D12_DEBUG=0 \ X2W_D3D12_RELEASE_RETIRED=1 X2W_D3D12_LAZY_TEXTURES=1 \ "$PROTON/files/bin/wine" ./startup_slot133_lazy_textures_check.exe warp ``` Result, deterministic over two runs (exit 5): ``` adapter=NVIDIA GeForce GTX 1660 SUPER debug_layer=off lazy=on retire=on FAIL: dispatch_translated did not materialize released tex_rel (retained=0, expected=1) ``` **And the cause is visible in the stand-in's own log, just before the assertion:** ``` x2w-draw compute pipeline c95980e7e8bace4d not translated: native translation without a revision; rebuild it x2w-draw compute c95980e7e8bace4d Dispatch(1, 1, 1) refused: native translation without a revision; rebuild it ``` So the dispatch is **refused before it binds anything**, which is why no retire hold is taken and `retained` stays 0. The `!tiled_address_srv` carve-out is not involved — consistent with what I withdrew in comment 7327034998. That refusal comes from `d3d12_compute_dispatch.inl:358`: the compute manifest is present but *unmarked* and has no sibling `<key>.cs.hlsl`. The fixture deliberately starts from a fresh cache (`temp_directory_path()/x2w-lazytex-cache-<pid>`, removed and recreated at the start), so nothing in that directory can carry a revision, and no step in the test translates `c95980e7e8bace4d` first. **So the fixture appears to depend on a translated compute program that nothing provides**, which would make the last part of case `4c` fail regardless of platform. Two ways out, and it is your call which: 1. have the fixture translate that program first (or ship a manifest that carries a revision), so the dispatch actually runs and the hold is exercised; or 2. apply the retire hold at binding time, *before* the translation check, if the intent is that a refused dispatch still holds the texture it named. I have not changed the test to make it pass — that would be exactly the "edit the assertion until green" move your review warned about. The tests stay out of the `pr` preset and this stays unexplained on my side.
triggered02 commented 2026-12-01 22:35:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T22:35:58Z.


One addendum to the two options in 7327938996 — I checked the code path, and it makes option 2 unnecessary while making option 1 the right fix. Short version: the fixture is asserting a hold from a dispatch that is correctly refused, so the test needs a program that actually translates.

What the code does: d3d12_compute_dispatch.inl returns reason at :1601 and only then reaches the bind loop, whose hold is at :1621. So a dispatch refused for an untranslated program takes no retire hold — and that is correct, not a bug: nothing is bound and nothing is read, so there is nothing to keep alive. Moving the hold before the translation check would retain textures for dispatches that never touch them, which is the opposite of what the switch is for.

So option 2 from my previous comment should be dropped, and the remedy is on the test side: give case 4c a compute program that translates — pre-seeded with a manifest carrying the current revision, or translated as part of the fixture — so that the dispatch reaches binding and the hold is genuinely exercised. As it stands the fresh empty cache means the program can never translate, so retained cannot become 1 and the assertion cannot pass on WARP, hardware or Wine alike.

That is where I stop: I am not going to rewrite the fixture around a translated-program dependency on a guess about how you want that seeded. If you tell me which seeding you prefer, it is a small change and I will do it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7328077500 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7328077500). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T22:35:58Z. --- One addendum to the two options in 7327938996 — I checked the code path, and it makes option 2 unnecessary while making option 1 the right fix. Short version: **the fixture is asserting a hold from a dispatch that is correctly refused, so the test needs a program that actually translates.** What the code does: `d3d12_compute_dispatch.inl` returns `reason` at `:1601` and only then reaches the bind loop, whose hold is at `:1621`. So a dispatch refused for an untranslated program takes no retire hold — and that is correct, not a bug: nothing is bound and nothing is read, so there is nothing to keep alive. Moving the hold before the translation check would retain textures for dispatches that never touch them, which is the opposite of what the switch is for. So option 2 from my previous comment should be dropped, and the remedy is on the test side: give case `4c` a compute program that translates — pre-seeded with a manifest carrying the current revision, or translated as part of the fixture — so that the dispatch reaches binding and the hold is genuinely exercised. As it stands the fresh empty cache means the program can never translate, so `retained` cannot become 1 and the assertion cannot pass on WARP, hardware or Wine alike. That is where I stop: I am not going to rewrite the fixture around a translated-program dependency on a guess about how you want that seeded. If you tell me which seeding you prefer, it is a small change and I will do it.
triggered02 commented 2026-12-01 22:44:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-01T22:44:03Z.


Ran the whole startup_slot133_lazy_textures_check matrix under Wine + vkd3d-proton, so you can see which failures are the untranslated-program problem and which are just this host. All with X2W_D3D12_BUDGET=1 X2W_D3D12_PERMISSIVE=1 X2W_D3D12_LIST_NOOP=1 X2W_D3D12_RENDER=1 X2W_RESOURCE_INDEX_CHECK=1 X2W_D3D12_DEBUG=0, adapter NVIDIA GeForce GTX 1660 SUPER, debug_layer=off.

Invocation Switches Result
warp LAZY_TEXTURES=1 RELEASE_RETIRED=1 FAIL dispatch_translated did not materialize released tex_rel (retained=0, expected=1)
warp no-retire LAZY_TEXTURES=1 FAIL … (retained=2, expected=3)
warp off RELEASE_RETIRED=1, lazy unset FAIL control WARP PagefileUsage delta=159744 expected >= 12 MiB

Two distinct causes, and neither is retire semantics:

  1. The two lazy cases miss exactly the dispatch-derived hold — retained is short by one in both (0/1 and 2/3), so every other hold in the case is taken. That is the refused dispatch from comment 7327938996: the program never translates from a fresh cache, so the bind loop is never reached.
  2. The off control fails on PagefileUsage, not on any texture or retire assertion. Under Wine the delta is ~156 KiB where Windows reports ≥12 MiB, so that control measures a Windows-only accounting value. I would treat this as an environment limitation of running the fixture under Wine, not as a defect in the control.

So under Wine, case 4c and the off control are both unachievable for reasons unrelated to this PR's logic — which also means a Wine run cannot substitute for the Windows result on point 4.

Still not editing the fixture. The remaining question is the same narrow one from 7328077500: how do you want 4c's compute program seeded with a translated manifest?

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7328258595 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7328258595). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-01T22:44:03Z. --- Ran the whole `startup_slot133_lazy_textures_check` matrix under Wine + vkd3d-proton, so you can see which failures are the untranslated-program problem and which are just this host. All with `X2W_D3D12_BUDGET=1 X2W_D3D12_PERMISSIVE=1 X2W_D3D12_LIST_NOOP=1 X2W_D3D12_RENDER=1 X2W_RESOURCE_INDEX_CHECK=1 X2W_D3D12_DEBUG=0`, adapter `NVIDIA GeForce GTX 1660 SUPER`, `debug_layer=off`. | Invocation | Switches | Result | |---|---|---| | `warp` | `LAZY_TEXTURES=1 RELEASE_RETIRED=1` | FAIL `dispatch_translated did not materialize released tex_rel (retained=0, expected=1)` | | `warp no-retire` | `LAZY_TEXTURES=1` | FAIL `… (retained=2, expected=3)` | | `warp off` | `RELEASE_RETIRED=1`, lazy unset | FAIL `control WARP PagefileUsage delta=159744 expected >= 12 MiB` | Two distinct causes, and neither is retire semantics: 1. **The two lazy cases** miss exactly the dispatch-derived hold — `retained` is short by one in both (`0/1` and `2/3`), so every other hold in the case is taken. That is the refused dispatch from comment 7327938996: the program never translates from a fresh cache, so the bind loop is never reached. 2. **The `off` control** fails on `PagefileUsage`, not on any texture or retire assertion. Under Wine the delta is ~156 KiB where Windows reports ≥12 MiB, so that control measures a Windows-only accounting value. I would treat this as an environment limitation of running the fixture under Wine, not as a defect in the control. So under Wine, case `4c` and the `off` control are both unachievable for reasons unrelated to this PR's logic — which also means a Wine run cannot substitute for the Windows result on point 4. Still not editing the fixture. The remaining question is the same narrow one from 7328077500: how do you want `4c`'s compute program seeded with a translated manifest?
triggered02 commented 2026-12-03 13:16:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-03T13:16:07Z.


The Windows job failed in 2m14s on run 47091491645 — my fault, and it never reached a test:

Test project D:/a/Xbox2Windows/Xbox2Windows/out/build/dev
No tests were found!!!
RegularExpression::compile(): Too many parentheses.
RegularExpression::compile(): Error in compile.
Errors while running CTest

My merge resolution added the new cases to the pr test filter as nested groups, which took it to 32 parenthesised subexpressions. CTest's engine refuses that many, so CTest could not compile the filter at all and reported no tests.

Fixed in 9657e2a1: the cases are spelled out as plain alternatives (startup_view_census_warp|startup_view_census_off_warp|...), which needs no extra parentheses, so the filter is back to main's count of 30. Checked against the registered names — all seven startup_view_census_* / startup_resource_retire_* cases match, startup_slot133_lazy_textures_warp_debug0 stays out (held back pending the retain-hold decision) and the _hardware variants stay out.

Worth knowing for anyone else touching that filter: the limit is the engine's, not CMake's, and it fails as "No tests were found" rather than as a filter error.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7379560622 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7379560622). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-03T13:16:07Z. --- The Windows job failed in 2m14s on run [47091491645](https://github.com/R0Y00/Xbox2Windows/actions/runs/47091491645) — my fault, and it never reached a test: ``` Test project D:/a/Xbox2Windows/Xbox2Windows/out/build/dev No tests were found!!! RegularExpression::compile(): Too many parentheses. RegularExpression::compile(): Error in compile. Errors while running CTest ``` My merge resolution added the new cases to the `pr` test filter as nested groups, which took it to 32 parenthesised subexpressions. CTest's engine refuses that many, so CTest could not compile the filter at all and reported no tests. Fixed in `9657e2a1`: the cases are spelled out as plain alternatives (`startup_view_census_warp|startup_view_census_off_warp|...`), which needs no extra parentheses, so the filter is back to `main`'s count of 30. Checked against the registered names — all seven `startup_view_census_*` / `startup_resource_retire_*` cases match, `startup_slot133_lazy_textures_warp_debug0` stays out (held back pending the retain-hold decision) and the `_hardware` variants stay out. Worth knowing for anyone else touching that filter: the limit is the engine's, not CMake's, and it fails as "No tests were found" rather than as a filter error.
triggered02 commented 2026-12-03 15:33:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-03T15:33:40Z.


@R0Y00 This addresses the one ask still open from your review — "Add the #2764 order of copy SRV, last guest Release, and first use through that still-live descriptor on a fresh list … Native first use must reach a materializer or stay on the eager path."

Why case 4c never reached the materializer. It hand-writes a native publication — a .txt manifest plus D3DCompile .cs.cso, deliberately with no Python-translator .cs.hlsl sidecar — but its manifest carried no native <revision> line. The compute gate therefore read it as stale Python output and refused it with native translation without a revision; rebuild it, so the dispatch never reached the texture and the case failed at dispatch_translated did not materialize released tex_rel (retained=0).

Fix (17119831): the manifest now ends with the same native <revision> line the runtime writer emits (direct_compute_cache.cpp), taking the number from native_compute_output.h so a future revision bump updates the fixture automatically. The .cs.hlsl sidecar would have been the wrong seam — it labels Python-translator output, which this is not.

Result on WARP, with the case 4c ctest environment:

lazy textures check passed (PagefileUsage delta=57344 bytes, materialized 2/16, retired cleanly)
x2w-draw compute pipeline c95980e7e8bace4d translated: 0 entry values, 1 inputs, 1 outputs
x2w-d3d12 lazy texture materialize wrapper=... -> 0x00000000
x2w-draw compute c95980e7e8bace4d Dispatch(1, 1, 1) translated: entry [0 0 0 0], 1 inputs, 1 outputs

The materialize line sits between pipeline creation and the translated dispatch, so it comes from the released descriptor vis_heap[4] used by the dispatch after Release(), not from a copy. retained goes 0 → 1 at the mid-flight assertion (temporarily instrumented, then reverted) and settles back to 0 when the gate fence opens.

warp debug0 and warp no-retire pass. Two variants behave for host reasons, both documented in the fixture's own notes: debug1 is a capability skip 77 (D3D12GetDebugInterface is unavailable under vkd3d), and off returns in its WARP-only PagefileUsage control before case 4c because vkd3d logs EnumWarpAdapter: WARP not supported, returning first hardware adapter.

0bc00914 puts the four warp cases back in the pr preset as flat alternatives (the filter stays at its 30-group CTest limit). That is the other half of what a70fa1db deferred; the Windows job is the check for the MSVC/WARP side.

Separately, 9657e2a1 fixed a CTest filter-parenthesis bug that made the previous Windows job fail before compiling anything, so that run carries no information about this branch.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7383351476 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7383351476). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-03T15:33:40Z. --- @R0Y00 This addresses the one ask still open from your review — *"Add the #2764 order of copy SRV, last guest Release, and first use through that still-live descriptor on a fresh list … Native first use must reach a materializer or stay on the eager path."* **Why case 4c never reached the materializer.** It hand-writes a *native* publication — a `.txt` manifest plus `D3DCompile` `.cs.cso`, deliberately with no Python-translator `.cs.hlsl` sidecar — but its manifest carried no `native <revision>` line. The compute gate therefore read it as stale Python output and refused it with `native translation without a revision; rebuild it`, so the dispatch never reached the texture and the case failed at `dispatch_translated did not materialize released tex_rel (retained=0)`. **Fix** (`17119831`): the manifest now ends with the same `native <revision>` line the runtime writer emits (`direct_compute_cache.cpp`), taking the number from `native_compute_output.h` so a future revision bump updates the fixture automatically. The `.cs.hlsl` sidecar would have been the wrong seam — it labels Python-translator output, which this is not. **Result on WARP, with the case 4c ctest environment:** ``` lazy textures check passed (PagefileUsage delta=57344 bytes, materialized 2/16, retired cleanly) x2w-draw compute pipeline c95980e7e8bace4d translated: 0 entry values, 1 inputs, 1 outputs x2w-d3d12 lazy texture materialize wrapper=... -> 0x00000000 x2w-draw compute c95980e7e8bace4d Dispatch(1, 1, 1) translated: entry [0 0 0 0], 1 inputs, 1 outputs ``` The materialize line sits between pipeline creation and the translated dispatch, so it comes from the released descriptor `vis_heap[4]` used by the dispatch *after* `Release()`, not from a copy. **`retained` goes 0 → 1** at the mid-flight assertion (temporarily instrumented, then reverted) and settles back to 0 when the gate fence opens. `warp debug0` and `warp no-retire` pass. Two variants behave for host reasons, both documented in the fixture's own notes: `debug1` is a capability skip 77 (`D3D12GetDebugInterface` is unavailable under vkd3d), and `off` returns in its WARP-only PagefileUsage control before case 4c because vkd3d logs `EnumWarpAdapter: WARP not supported, returning first hardware adapter`. **`0bc00914`** puts the four `warp` cases back in the `pr` preset as flat alternatives (the filter stays at its 30-group CTest limit). That is the other half of what `a70fa1db` deferred; the Windows job is the check for the MSVC/WARP side. Separately, `9657e2a1` fixed a CTest filter-parenthesis bug that made the previous Windows job fail before compiling anything, so that run carries no information about this branch.
triggered02 commented 2026-12-03 15:46:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-03T15:46:22Z.


Heads up on the two commits I just pushed: this branch had gone DIRTY, and a conflicted PR gets no pull_request run at all — GitHub cannot build the merge ref — which is why the branch appeared to have no CI on 0bc00914. Nothing was wrong with the change; the job simply never started.

30aa267f merges current main and resolves two conflicts, both additive:

  • src/startup_stubs/d3d12_xs_device.cpp: main's new x2w_d3d12_fixture_wait_mesh57_targets export and this branch's x2w_d3d12_lazy_texture_count sit side by side; no behaviour from either side dropped.
  • CMakePresets.json: rebuilt from main's file and the branch's entries re-appended as flat alternatives (the filter is back at its CTest limit of 30 groups and verified to compile).

991b707d re-pins the export catalog, which the merge moved from 87 to 89 entries (35 implemented + 54 unmeasured) — measured by running tests/standin_exports_check.py and reading what it reported, not computed. The check now passes: 483 cases, 6/6 mutations killed.

Build after the merge: d3d12_xs_shim links with clang-cl/xwin once the worktree's stale DXC_EXECUTABLE (a Windows dxc.exe left in the build cache) is pointed at the Linux one — worth knowing if a maintainer builds this branch on Linux from an old build directory.

Also in this branch now: 17119831 seeds case 4c's native revision marker (that is the commit that makes native first use reach the materializer — retained 0 → 1 on WARP) and 0bc00914 puts the four warp cases back in the pr preset.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7383707333 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7383707333). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-03T15:46:22Z. --- Heads up on the two commits I just pushed: this branch had gone **DIRTY**, and a conflicted PR gets no `pull_request` run at all — GitHub cannot build the merge ref — which is why the branch appeared to have no CI on `0bc00914`. Nothing was wrong with the change; the job simply never started. `30aa267f` merges current `main` and resolves two conflicts, both additive: - `src/startup_stubs/d3d12_xs_device.cpp`: main's new `x2w_d3d12_fixture_wait_mesh57_targets` export and this branch's `x2w_d3d12_lazy_texture_count` sit side by side; no behaviour from either side dropped. - `CMakePresets.json`: rebuilt from main's file and the branch's entries re-appended as flat alternatives (the filter is back at its CTest limit of 30 groups and verified to compile). `991b707d` re-pins the export catalog, which the merge moved from 87 to **89** entries (35 implemented + 54 unmeasured) — measured by running `tests/standin_exports_check.py` and reading what it reported, not computed. The check now passes: `483 cases, 6/6 mutations killed`. Build after the merge: `d3d12_xs_shim` links with clang-cl/xwin once the worktree's stale `DXC_EXECUTABLE` (a Windows `dxc.exe` left in the build cache) is pointed at the Linux one — worth knowing if a maintainer builds this branch on Linux from an old build directory. Also in this branch now: `17119831` seeds case 4c's native revision marker (that is the commit that makes native first use reach the materializer — `retained` 0 → 1 on WARP) and `0bc00914` puts the four `warp` cases back in the `pr` preset.
triggered02 commented 2026-12-03 15:59:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-03T15:59:40Z.


Green on the merged head: Build and test on Windows passed, along with gfx1013 and the Linux Python checks, so the merge resolution and the re-pinned export catalog (89 entries) are both good.

That also confirms the earlier diagnosis: the branch had no run at all because a conflicted PR cannot produce a merge ref, so nothing was ever queued. Once main was merged in, CI started within two minutes.

Case 4c now demonstrates the ask from your review — native first use reaches the materializer, retained 0 → 1 on WARP — and the four warp cases are back in the pr preset.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7384077383 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7384077383). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-03T15:59:40Z. --- Green on the merged head: `Build and test on Windows` **passed**, along with gfx1013 and the Linux Python checks, so the merge resolution and the re-pinned export catalog (89 entries) are both good. That also confirms the earlier diagnosis: the branch had no run at all because a conflicted PR cannot produce a merge ref, so nothing was ever queued. Once `main` was merged in, CI started within two minutes. Case 4c now demonstrates the ask from your review — native first use reaches the materializer, `retained` 0 → 1 on WARP — and the four `warp` cases are back in the `pr` preset.
R0Y00 commented 2026-12-03 16:12:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T16:12:11Z.


Release/O2 retest at 991b707d on Windows 11 build 26300: MSVC build of startup_slot133_lazy_textures_check and startup_resource_retire_title, then ctest --test-dir out/build/review-release --no-tests=error -j 1 -V -R '^(startup_slot133_lazy_textures|startup_resource_retire_title)' passed 18/18 on WARP and RTX 4060 Laptop, including debug-layer variants, with no skips. I did not reproduce the prior Release retire crashes. The refresh now revalidates the heap and record under note_lock at publication. The required hosted Windows smoke check is green.

After #3937 landed, the current main trial merge has one CMakePresets.json conflict. Please keep the new startup_indirect_translated_argument_snapshot_warp selector alongside the lazy-texture selectors and rerun the focused suite on the refreshed head.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7384441017 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7384441017). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T16:12:11Z. --- Release/O2 retest at 991b707d on Windows 11 build 26300: MSVC build of startup_slot133_lazy_textures_check and startup_resource_retire_title, then ctest --test-dir out/build/review-release --no-tests=error -j 1 -V -R '^(startup_slot133_lazy_textures|startup_resource_retire_title)' passed 18/18 on WARP and RTX 4060 Laptop, including debug-layer variants, with no skips. I did not reproduce the prior Release retire crashes. The refresh now revalidates the heap and record under note_lock at publication. The required hosted Windows smoke check is green. After #3937 landed, the current main trial merge has one CMakePresets.json conflict. Please keep the new startup_indirect_translated_argument_snapshot_warp selector alongside the lazy-texture selectors and rerun the focused suite on the refreshed head.
triggered02 commented 2026-12-03 16:39:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-03T16:39:12Z.


Merged current main (4324d81f) into the branch — 89adb031. The one conflict was CMakePresets.json, exactly as you predicted.

Resolution. Your pr filter now ends with the indirect argument snapshot selector; this branch adds twelve names (lazy-texture ×4, view-census ×3, resource-retire ×5). Both sides are flat alternatives in the same filter, so I kept your line and appended the twelve before the closing )$. No group is added, so the parenthesis budget is unchanged: 31 ( / 31 ).

Verified that the filter itself is still valid (the failure mode from 9657e2a1):

$ ctest --test-dir out/build/clang -N -R "<the pr filter>"
Total Tests: 104

ctest -N matches 104 tests and prints no Too many parentheses / No tests were found!!!. Both startup_indirect_translated_argument_snapshot_warp (from main) and startup_slot133_lazy_textures_warp_debug0 (from this branch) are registered and matched.

Focused suite on the refreshed head, Linux host (clang-cl/xwin build, Wine + vkd3d-proton, GTX 1660 SUPER). I ran the eight selectors this branch owns plus the two indirect-snapshot selectors now in pr:

5 passed, 2 skipped, 3 failed
  PASS startup_slot133_lazy_textures_warp_debug0      lazy textures check passed (PagefileUsage delta=49152, materialized 2/16, retired cleanly)
  PASS startup_slot133_lazy_textures_noretire_warp     same
  PASS startup_resource_retire_title_inline_warp_debug0
  SKIP startup_slot133_lazy_textures_warp_debug1      77, D3D12GetDebugInterface unavailable under vkd3d
  SKIP startup_resource_retire_title_inline_warp_debug1  same
  FAIL startup_slot133_lazy_textures_off_warp         Wine-only accounting: "control WARP PagefileUsage delta=200704 expected >= 12 MiB" (measured before case 4c)
  FAIL startup_indirect_translated_indexed_snapshot_warp   see below
  FAIL startup_indirect_translated_argument_snapshot_warp  see below

Neither indirect-snapshot failure is about the merge: both stop at the translated-HLSL compile with

<anonymous>:90:8: E5005: Method 'InterlockedAdd' is not defined on type 'RWByteAddressBuffer'
translated_indexed_vertex failed (HRESULT 0x80004005)

which is append_mesh_groups in the fixture's shader string. I re-ran the same mode from a prebuilt binary of an older tree (x2w-3937-fixture, before this branch merged anything) and it fails identically, so this is the Linux DXC build here, not the head. A one-line repro in a standalone .hlsl with -T vs_5_1 compiles cleanly on the same dxc, so I do not know why this entry set trips it — I am reporting it as a host limitation, not a property of the change. The hosted Windows job on 89adb031 is the check for those two, and the merged head's earlier Windows run was green.

Two other notes: tests/standin_exports_check.py still reports 483 cases, 6/6 mutations killed with the pin at 89 entries, so the merge did not move the catalog; and d3d12_xs_shim links on the refreshed head with clang-cl/xwin (the stale DXC_EXECUTABLE in the build cache is the only local wrinkle, as before).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7385207957 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7385207957). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-03T16:39:12Z. --- Merged current `main` (`4324d81f`) into the branch — `89adb031`. The one conflict was `CMakePresets.json`, exactly as you predicted. **Resolution.** Your `pr` filter now ends with the indirect argument snapshot selector; this branch adds twelve names (lazy-texture ×4, view-census ×3, resource-retire ×5). Both sides are flat alternatives in the same filter, so I kept your line and appended the twelve before the closing `)$`. No group is added, so the parenthesis budget is unchanged: 31 `(` / 31 `)`. **Verified that the filter itself is still valid** (the failure mode from `9657e2a1`): ``` $ ctest --test-dir out/build/clang -N -R "<the pr filter>" Total Tests: 104 ``` `ctest -N` matches 104 tests and prints no `Too many parentheses` / `No tests were found!!!`. Both `startup_indirect_translated_argument_snapshot_warp` (from main) and `startup_slot133_lazy_textures_warp_debug0` (from this branch) are registered and matched. **Focused suite on the refreshed head, Linux host (clang-cl/xwin build, Wine + vkd3d-proton, GTX 1660 SUPER).** I ran the eight selectors this branch owns plus the two indirect-snapshot selectors now in `pr`: ``` 5 passed, 2 skipped, 3 failed PASS startup_slot133_lazy_textures_warp_debug0 lazy textures check passed (PagefileUsage delta=49152, materialized 2/16, retired cleanly) PASS startup_slot133_lazy_textures_noretire_warp same PASS startup_resource_retire_title_inline_warp_debug0 SKIP startup_slot133_lazy_textures_warp_debug1 77, D3D12GetDebugInterface unavailable under vkd3d SKIP startup_resource_retire_title_inline_warp_debug1 same FAIL startup_slot133_lazy_textures_off_warp Wine-only accounting: "control WARP PagefileUsage delta=200704 expected >= 12 MiB" (measured before case 4c) FAIL startup_indirect_translated_indexed_snapshot_warp see below FAIL startup_indirect_translated_argument_snapshot_warp see below ``` Neither indirect-snapshot failure is about the merge: both stop at the translated-HLSL compile with ``` <anonymous>:90:8: E5005: Method 'InterlockedAdd' is not defined on type 'RWByteAddressBuffer' translated_indexed_vertex failed (HRESULT 0x80004005) ``` which is `append_mesh_groups` in the fixture's shader string. I re-ran the same mode from a **prebuilt binary of an older tree** (`x2w-3937-fixture`, before this branch merged anything) and it fails identically, so this is the Linux DXC build here, not the head. A one-line repro in a standalone `.hlsl` with `-T vs_5_1` compiles cleanly on the same dxc, so I do not know why this entry set trips it — I am reporting it as a host limitation, not a property of the change. **The hosted Windows job on `89adb031` is the check for those two**, and the merged head's earlier Windows run was green. Two other notes: `tests/standin_exports_check.py` still reports **483 cases, 6/6 mutations killed** with the pin at 89 entries, so the merge did not move the catalog; and `d3d12_xs_shim` links on the refreshed head with clang-cl/xwin (the stale `DXC_EXECUTABLE` in the build cache is the only local wrinkle, as before).
triggered02 commented 2026-12-03 16:50:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-03T16:50:08Z.


The hosted jobs on 89adb031 finished green: Build and test on Windows SUCCESS, gfx1013 SUCCESS, Linux Python checks SUCCESS. So the union filter and the merge resolution are confirmed by the Windows side too; the three Linux-only failures I listed above did not reproduce there.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7385524691 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#issuecomment-7385524691). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-03T16:50:08Z. --- The hosted jobs on `89adb031` finished green: **Build and test on Windows** SUCCESS, gfx1013 SUCCESS, Linux Python checks SUCCESS. So the union filter and the merge resolution are confirmed by the Windows side too; the three Linux-only failures I listed above did not reproduce there.
R0Y00 commented 2026-12-03 17:16:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T17:16:20Z.

Review: APPROVED


Re-reviewed 89adb031. The current main merge retains the indirect argument/index and draw controls alongside the four lazy-texture WARP selectors in the PR preset. Rebuilt startup_slot133_lazy_textures_check and startup_resource_retire_title with MSVC Release (/O2) and ran ctest --test-dir out/build/review-release --no-tests=error -j 1 -V -R '^(startup_slot133_lazy_textures|startup_resource_retire_title)'. All 18 passed on WARP and RTX 4060 Laptop on Windows 11 build 26300, including both debug-layer modes, 0 skips. The overwrite/heap-retirement control and the copied-SRV after final release on a fresh native dispatch remain in the source-built fixture. The earlier Release retirement failures did not recur. Hosted required Windows CI passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6174753715 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2773#pullrequestreview-6174753715). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T17:16:20Z. **Review:** APPROVED --- Re-reviewed 89adb031. The current main merge retains the indirect argument/index and draw controls alongside the four lazy-texture WARP selectors in the PR preset. Rebuilt startup_slot133_lazy_textures_check and startup_resource_retire_title with MSVC Release (/O2) and ran ctest --test-dir out/build/review-release --no-tests=error -j 1 -V -R '^(startup_slot133_lazy_textures|startup_resource_retire_title)'. All 18 passed on WARP and RTX 4060 Laptop on Windows 11 build 26300, including both debug-layer modes, 0 skips. The overwrite/heap-retirement control and the copied-SRV after final release on a fresh native dispatch remain in the source-built fixture. The earlier Release retirement failures did not recur. Hosted required Windows CI passed.
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!2765
No description provided.