d3d12: coherent page-tracked backing for non-aliased placed buffer SR… #3776

Merged
Holastor merged 11 commits from upstream-pr/3776 into main 2026-12-02 15:58:07 +00:00
Holastor commented 2026-12-01 18:54:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-12-01T18:54:05Z.


Closes #3640

Summary

Supplies coherent, incrementally refreshed desktop buffer backing for non-aliased (!placed.alias) placed buffer SRVs in indirect_table_buffer (src/startup_stubs/d3d12_draw.inl), including large buffers exceeding the 16 MiB title_input_snapshot limit (such as the 174 MiB 0xae00000 buffer).

  • Incremental 64 KiB dirty-page refresh (src/startup_stubs/coherent_placed_buffer.inl): Tracks 64 KiB page hashes in title_memory, coalesces contiguous dirty pages into minimal CopyBufferRegion uploads from a staging upload buffer with COMMON -> COPY_DEST -> COMMON transitions, and cleans up tracker state on resource retirement.
  • Mixed CPU/GPU write protection & named refusals (src/startup_stubs/d3d12_draw.inl): Marks buffers written on the GPU (gpu_written / mark_gpu_written) so subsequent CPU-backed refreshes do not clobber GPU outputs, returning explicit named refusals ("an input is in a placed buffer with mixed GPU and CPU writes", "an input range is outside its placed buffer", "an input range in title memory is not readable"). Preserves existing indirect_table_copied_gpu_range and committed_root_srv (#3718) paths.
  • Fixture & CI wiring (tests/startup_coherent_placed_srv.cpp, tests/cmake/coherent_placed_srv.cmake, tests/standin_exports_check.py): Adds startup_coherent_placed_srv_<backend> and updates d3d12_xs export expectations (79 -> 80).

Fixture Coverage (startup_coherent_placed_srv)

Scenario Expected Behavior Result (dev & release)
Two GPU-selected SRVs in one placed buffer (page 0 & page 2) Read distinct updated values (0x11223344 and 0x55667788) after CopyBufferRegion PASS (WARP & AMD hardware)
Cross-queue visibility (queue_a -> Signal -> queue_b Wait) Readback on queue_b observes updated data after fence PASS (WARP & AMD hardware)
Mixed GPU + CPU writes without synchronization Explicit named refusal "an input is in a placed buffer with mixed GPU and CPU writes" Verified in indirect_table_buffer
Incremental 64 KiB dirty-page refresh Coalesces and copies only dirty 64 KiB pages without full-buffer upload Verified in x2w_coherent_placed::refresh_range
tests/standin_exports_check.py Accounts for x2w_coherent_placed_refresh export (80 entries) PASS (471 cases, 6/6 mutations killed)

Verification

  • ctest --preset release --no-tests=error -R "^startup_coherent_placed_srv_(warp|hardware)$" -V — 2/2 passed (WARP 0.06s, AMD Radeon hardware 0.14s, 0 debug layer errors)
  • python -B tests/standin_exports_check.py — passed (471 cases, 6/6 mutations killed)
  • python -B tests/docs_links_check.py & python -B tests/bidi_controls_check.py — passed
  • Title startup run (-Console s -Gpu amd, 90s): compute dispatches went from 1 translated / 4645 refused to 1453 translated / 0 refused with zero placed buffer refusals.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5592362347 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776). Originally posted by [Holastor](https://github.com/Holastor) on 2026-12-01T18:54:05Z. --- Closes #3640 ## Summary Supplies coherent, incrementally refreshed desktop buffer backing for non-aliased (`!placed.alias`) placed buffer SRVs in `indirect_table_buffer` (`src/startup_stubs/d3d12_draw.inl`), including large buffers exceeding the 16 MiB `title_input_snapshot` limit (such as the 174 MiB `0xae00000` buffer). - **Incremental 64 KiB dirty-page refresh (`src/startup_stubs/coherent_placed_buffer.inl`):** Tracks 64 KiB page hashes in `title_memory`, coalesces contiguous dirty pages into minimal `CopyBufferRegion` uploads from a staging upload buffer with `COMMON -> COPY_DEST -> COMMON` transitions, and cleans up tracker state on resource retirement. - **Mixed CPU/GPU write protection & named refusals (`src/startup_stubs/d3d12_draw.inl`):** Marks buffers written on the GPU (`gpu_written` / `mark_gpu_written`) so subsequent CPU-backed refreshes do not clobber GPU outputs, returning explicit named refusals (`"an input is in a placed buffer with mixed GPU and CPU writes"`, `"an input range is outside its placed buffer"`, `"an input range in title memory is not readable"`). Preserves existing `indirect_table_copied_gpu_range` and `committed_root_srv` (#3718) paths. - **Fixture & CI wiring (`tests/startup_coherent_placed_srv.cpp`, `tests/cmake/coherent_placed_srv.cmake`, `tests/standin_exports_check.py`):** Adds `startup_coherent_placed_srv_<backend>` and updates `d3d12_xs` export expectations (`79 -> 80`). ## Fixture Coverage (`startup_coherent_placed_srv`) | Scenario | Expected Behavior | Result (dev & release) | | --- | --- | --- | | Two GPU-selected SRVs in one placed buffer (page 0 & page 2) | Read distinct updated values (`0x11223344` and `0x55667788`) after `CopyBufferRegion` | PASS (WARP & AMD hardware) | | Cross-queue visibility (`queue_a` -> `Signal` -> `queue_b` `Wait`) | Readback on `queue_b` observes updated data after fence | PASS (WARP & AMD hardware) | | Mixed GPU + CPU writes without synchronization | Explicit named refusal `"an input is in a placed buffer with mixed GPU and CPU writes"` | Verified in `indirect_table_buffer` | | Incremental 64 KiB dirty-page refresh | Coalesces and copies only dirty 64 KiB pages without full-buffer upload | Verified in `x2w_coherent_placed::refresh_range` | | `tests/standin_exports_check.py` | Accounts for `x2w_coherent_placed_refresh` export (`80` entries) | PASS (`471` cases, `6/6` mutations killed) | ## Verification - `ctest --preset release --no-tests=error -R "^startup_coherent_placed_srv_(warp|hardware)$" -V` — 2/2 passed (WARP `0.06s`, AMD Radeon hardware `0.14s`, 0 debug layer errors) - `python -B tests/standin_exports_check.py` — passed (`471` cases, `6/6` mutations killed) - `python -B tests/docs_links_check.py` & `python -B tests/bidi_controls_check.py` — passed - Title startup run (`-Console s -Gpu amd`, 90s): compute dispatches went from `1 translated / 4645 refused` to `1453 translated / 0 refused` with zero `placed buffer` refusals.
Holastor commented 2026-12-01 21:43:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-12-01T21:43:00Z.


Addressed the gpu_written provenance case (commit c7a96c0d):

  • x2w_coherent_placed::mark_gpu_written / is_gpu_written now track ID3D12Resource* in gpu_written_set() even before a BackingState is created, and refresh_range refuses when is_gpu_written(resource) is true.
  • list_copy_buffer_region and list_copy_resource (buffers) call x2w_coherent_placed::mark_gpu_written(to.resource).
  • Added a provenance negative control to tests/startup_coherent_placed_srv.cpp verifying that a CopyBufferRegion before the first refresh_range causes refresh_range to refuse and leaves GPU-written bytes untouched.

Verified on release:

  • ctest --preset release --no-tests=error -R ^startup_coherent_placed_srv_(warp|hardware)$ -V: 2/2 passed
  • tests/standin_exports_check.py: 470 cases, 6/6 mutations killed PASS
  • tests/startup_triage_run_check.py: 0 failed
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7326679089 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776#issuecomment-7326679089). Originally posted by [Holastor](https://github.com/Holastor) on 2026-12-01T21:43:00Z. --- Addressed the gpu_written provenance case (commit c7a96c0d): - x2w_coherent_placed::mark_gpu_written / is_gpu_written now track ID3D12Resource* in gpu_written_set() even before a BackingState is created, and refresh_range refuses when is_gpu_written(resource) is true. - list_copy_buffer_region and list_copy_resource (buffers) call x2w_coherent_placed::mark_gpu_written(to.resource). - Added a provenance negative control to tests/startup_coherent_placed_srv.cpp verifying that a CopyBufferRegion before the first refresh_range causes refresh_range to refuse and leaves GPU-written bytes untouched. Verified on release: - ctest --preset release --no-tests=error -R ^startup_coherent_placed_srv_(warp|hardware)$ -V: 2/2 passed - tests/standin_exports_check.py: 470 cases, 6/6 mutations killed PASS - tests/startup_triage_run_check.py: 0 failed
R0Y00 commented 2026-12-02 01:50:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T01:50:09Z.


Blocking coherence issues in the current refresh_range: (1) page_valid and page_hashes are updated before allocation, Map, or submission, so a failed upload can make the retry report clean without uploading anything. Likewise, recording list A then recording list B can make B skip a copy even if A is reset or never submitted. Please separate pending uploads from backing known visible to the consuming list/queue, with failed-allocation retry and unsubmitted/reset-list controls. (2) list_already_refreshed computes s.offset + s.bytes - offset without first bounding offset by the span end. For [0, 64 KiB) followed by [128 KiB, 128 KiB + 4), unsigned subtraction wraps and accepts a disjoint page. Please add that same-list control.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7332161813 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776#issuecomment-7332161813). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T01:50:09Z. --- Blocking coherence issues in the current `refresh_range`: (1) `page_valid` and `page_hashes` are updated before allocation, Map, or submission, so a failed upload can make the retry report clean without uploading anything. Likewise, recording list A then recording list B can make B skip a copy even if A is reset or never submitted. Please separate pending uploads from backing known visible to the consuming list/queue, with failed-allocation retry and unsubmitted/reset-list controls. (2) `list_already_refreshed` computes `s.offset + s.bytes - offset` without first bounding `offset` by the span end. For `[0, 64 KiB)` followed by `[128 KiB, 128 KiB + 4)`, unsigned subtraction wraps and accepts a disjoint page. Please add that same-list control.
Holastor commented 2026-12-02 06:59:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-12-02T06:59:17Z.


Addressed both blocking review items from @R0Y00 (commit 778caf75):

  1. Separated per-list pending state from committed BackingState and added failure rollback (src/startup_stubs/coherent_placed_buffer.inl, src/startup_stubs/d3d12_xs_device.cpp):

    • refresh_range reads committed BackingState and the calling list's ListPending hashes without mutating either until CreateCommittedResource, Map, memcpy, barriers, and CopyBufferRegion succeed. On allocation or Map failure, it returns false with *out_copied_bytes == 0 and leaves page state untouched so retries upload the dirty pages.
    • Page updates are staged per ID3D12CommandList* in ListPending (deduplicating within the same list without hiding dirty pages from other command lists) and transferred into BackingState (with last_submit_queue, last_submit_fence, and last_submit_fence_value) only in queue_execute via commit_lists after ExecuteCommandLists (with cross-queue before_submit fence wait when another queue relies on committed state).
    • list_reset, failed list_close, and list release call x2w_coherent_placed::discard_list to drop unsubmitted pending state; drain_retired_resources calls x2w_coherent_placed::erase.
  2. Fixed unsigned underflow in list_already_refreshed (src/startup_stubs/coherent_placed_buffer.inl):

    • Bounded offset against the span end (s.offset <= offset, rel = offset - s.offset, rel < s.bytes && bytes <= s.bytes - rel) so disjoint ranges like [0, 64 KiB) followed by [128 KiB, 128 KiB + 4) no longer wrap.
  3. Added the 3 requested controls in tests/startup_coherent_placed_srv.cpp:

    • Disjoint page same-list control: records [0, 64 KiB) then [128 KiB, 128 KiB + 4) (plus a duplicate [128 KiB, 128 KiB + 4) check) on the same list and verifies GPU readback on both pages.
    • Failed-allocation / Map retry control: exercises simulated CreateCommittedResource and Map failures (UploadFaultMode::create / UploadFaultMode::map), verifies false return and unchanged copied_bytes / committed_page_valid, then retries and verifies GPU readback.
    • Unsubmitted / reset-list control: covers both list_a->Reset() without submit and list_a left unsubmitted before list_b records and submits, verifying list_b still uploads the page and GPU readback sees the expected bytes.

Verified on release (commit 778caf75):

  • .\tools\dev.ps1; cmake --build --preset release --target d3d12_xs_shim startup_coherent_placed_srv: exit 0
  • ctest --preset release --no-tests=error -R "^startup_coherent_placed_srv_(warp|hardware)$" -V: 2/2 passed (startup_coherent_placed_srv_warp, startup_coherent_placed_srv_hardware)
  • .\out\pe-env\Scripts\python.exe -B tests\standin_exports_check.py: 470 cases, 6/6 mutations killed PASS
  • .\out\pe-env\Scripts\python.exe -B tests\startup_triage_run_check.py: 0 failed
  • .\out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py: Self-test passed
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7337639377 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776#issuecomment-7337639377). Originally posted by [Holastor](https://github.com/Holastor) on 2026-12-02T06:59:17Z. --- Addressed both blocking review items from @R0Y00 (commit `778caf75`): 1. **Separated per-list pending state from committed `BackingState` and added failure rollback (`src/startup_stubs/coherent_placed_buffer.inl`, `src/startup_stubs/d3d12_xs_device.cpp`):** - `refresh_range` reads committed `BackingState` and the calling list's `ListPending` hashes without mutating either until `CreateCommittedResource`, `Map`, `memcpy`, barriers, and `CopyBufferRegion` succeed. On allocation or `Map` failure, it returns `false` with `*out_copied_bytes == 0` and leaves page state untouched so retries upload the dirty pages. - Page updates are staged per `ID3D12CommandList*` in `ListPending` (deduplicating within the same list without hiding dirty pages from other command lists) and transferred into `BackingState` (with `last_submit_queue`, `last_submit_fence`, and `last_submit_fence_value`) only in `queue_execute` via `commit_lists` after `ExecuteCommandLists` (with cross-queue `before_submit` fence wait when another queue relies on committed state). - `list_reset`, failed `list_close`, and list `release` call `x2w_coherent_placed::discard_list` to drop unsubmitted pending state; `drain_retired_resources` calls `x2w_coherent_placed::erase`. 2. **Fixed unsigned underflow in `list_already_refreshed` (`src/startup_stubs/coherent_placed_buffer.inl`):** - Bounded `offset` against the span end (`s.offset <= offset`, `rel = offset - s.offset`, `rel < s.bytes && bytes <= s.bytes - rel`) so disjoint ranges like `[0, 64 KiB)` followed by `[128 KiB, 128 KiB + 4)` no longer wrap. 3. **Added the 3 requested controls in `tests/startup_coherent_placed_srv.cpp`:** - **Disjoint page same-list control:** records `[0, 64 KiB)` then `[128 KiB, 128 KiB + 4)` (plus a duplicate `[128 KiB, 128 KiB + 4)` check) on the same list and verifies GPU readback on both pages. - **Failed-allocation / `Map` retry control:** exercises simulated `CreateCommittedResource` and `Map` failures (`UploadFaultMode::create` / `UploadFaultMode::map`), verifies `false` return and unchanged `copied_bytes` / `committed_page_valid`, then retries and verifies GPU readback. - **Unsubmitted / reset-list control:** covers both `list_a->Reset()` without submit and `list_a` left unsubmitted before `list_b` records and submits, verifying `list_b` still uploads the page and GPU readback sees the expected bytes. Verified on `release` (commit `778caf75`): - `.\tools\dev.ps1; cmake --build --preset release --target d3d12_xs_shim startup_coherent_placed_srv`: exit 0 - `ctest --preset release --no-tests=error -R "^startup_coherent_placed_srv_(warp|hardware)$" -V`: `2/2` passed (`startup_coherent_placed_srv_warp`, `startup_coherent_placed_srv_hardware`) - `.\out\pe-env\Scripts\python.exe -B tests\standin_exports_check.py`: `470 cases, 6/6 mutations killed PASS` - `.\out\pe-env\Scripts\python.exe -B tests\startup_triage_run_check.py`: `0 failed` - `.\out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py`: `Self-test passed`
R0Y00 commented 2026-12-02 11:39:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T11:39:56Z.

Review: CHANGES_REQUESTED


On a9344430, ctest --preset dev --no-tests=error -j 1 -V -R '^startup_coherent_placed_srv_(warp|hardware)$' passed 2/2 on Windows 11 26300.9974. The fixture selected WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, debug layer off. The disjoint-page, allocation/Map retry and discarded-list cases now pass.

One cross-queue lifetime gap remains. before_submit() waits on the last recorded upload fence. A submitted list that only references already committed pages adds no staged updates or uploads, so commit_lists() returns without recording its completion. A later refresh on a different queue can therefore insert a copy into the backing while the clean consumer is still reading it. The fixture's cross-queue case uses a manual queue wait and does not exercise that dependency. Please add a source-built control with a gated clean consumer on one queue, then a dirty refresh on another, and track the consumer's completion before overwriting its pages.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6150014300 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776#pullrequestreview-6150014300). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T11:39:56Z. **Review:** CHANGES_REQUESTED --- On `a9344430`, `ctest --preset dev --no-tests=error -j 1 -V -R '^startup_coherent_placed_srv_(warp|hardware)$'` passed 2/2 on Windows 11 26300.9974. The fixture selected WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, debug layer off. The disjoint-page, allocation/Map retry and discarded-list cases now pass. One cross-queue lifetime gap remains. `before_submit()` waits on the last recorded upload fence. A submitted list that only references already committed pages adds no staged updates or uploads, so `commit_lists()` returns without recording its completion. A later refresh on a different queue can therefore insert a copy into the backing while the clean consumer is still reading it. The fixture's cross-queue case uses a manual queue wait and does not exercise that dependency. Please add a source-built control with a gated clean consumer on one queue, then a dirty refresh on another, and track the consumer's completion before overwriting its pages.
Holastor commented 2026-12-02 12:08:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-12-02T12:08:27Z.


Addressed the remaining cross-queue lifetime gap (commit 19d2bb33):

  • refresh_range() records the pages a list reads in per-list ListPending.read_pages, on both the dirty and the already-clean path (copied_bytes == 0).
  • commit_lists() now publishes per-page, per-queue reader fences (last_reader_queue/fence/value in BackingState::page_readers) even when the list staged no uploads or updates; a later submit on the same queue supersedes that queue's reader entry, readers on other queues stay.
  • before_submit() waits the submitting queue on every other queue's reader fence for the pages its dirty copies are about to overwrite (completed fences are skipped, duplicate fences merge by max value).
  • discard_list()/erase() drop unsaved read_pages.

Fixture: new section 6 is the requested source-built control with no manual cross-queue Wait between the reader and the writer: a gated clean consumer on queue_a (queue_a->Wait(gate,1), clean refresh + copy into out_a), then a dirty refresh of the same page on queue_b (title value 0x11223344 -> 0x99AABBCC, copy into out_b), then the gate is signaled. Readback checks out_a == 0x11223344 and out_b == 0x99AABBCC.

Evidence on 19d2bb33, Windows 11 26300.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, debug layer off:

  • ctest --preset release --no-tests=error -R '^startup_coherent_placed_srv_(warp|hardware)$' passed 2/2.
  • Negative control: with the .inl change reverted (fixture kept), the new case fails with gated: dirty refresh overwrote the backing before the clean reader finished, so the case exercises exactly the dependency described.
  • standin_exports_check.py (470 cases, 6/6 mutations killed), startup_triage_run_check.py and bidi_controls_check.py pass.

Full-game execution remains unverified; this covers the fixture-level cross-queue ordering.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7344897404 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776#issuecomment-7344897404). Originally posted by [Holastor](https://github.com/Holastor) on 2026-12-02T12:08:27Z. --- Addressed the remaining cross-queue lifetime gap (commit 19d2bb33): - `refresh_range()` records the pages a list reads in per-list `ListPending.read_pages`, on both the dirty and the already-clean path (`copied_bytes == 0`). - `commit_lists()` now publishes per-page, per-queue reader fences (`last_reader_queue`/`fence`/`value` in `BackingState::page_readers`) even when the list staged no uploads or updates; a later submit on the same queue supersedes that queue's reader entry, readers on other queues stay. - `before_submit()` waits the submitting queue on every other queue's reader fence for the pages its dirty copies are about to overwrite (completed fences are skipped, duplicate fences merge by max value). - `discard_list()`/`erase()` drop unsaved `read_pages`. Fixture: new section 6 is the requested source-built control with no manual cross-queue `Wait` between the reader and the writer: a gated clean consumer on queue_a (`queue_a->Wait(gate,1)`, clean refresh + copy into out_a), then a dirty refresh of the same page on queue_b (title value 0x11223344 -> 0x99AABBCC, copy into out_b), then the gate is signaled. Readback checks out_a == 0x11223344 and out_b == 0x99AABBCC. Evidence on 19d2bb33, Windows 11 26300.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, debug layer off: - `ctest --preset release --no-tests=error -R '^startup_coherent_placed_srv_(warp|hardware)$'` passed 2/2. - Negative control: with the `.inl` change reverted (fixture kept), the new case fails with `gated: dirty refresh overwrote the backing before the clean reader finished`, so the case exercises exactly the dependency described. - `standin_exports_check.py` (470 cases, 6/6 mutations killed), `startup_triage_run_check.py` and `bidi_controls_check.py` pass. Full-game execution remains unverified; this covers the fixture-level cross-queue ordering.
R0Y00 commented 2026-12-02 12:28:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T12:28:18Z.

Review: APPROVED


The clean-reader lifetime finding is addressed on 19d2bb33. The clean path now publishes its reader fence, and a dirty submission checks it before executing. The source-built fixture passes 2/2 with ctest --preset dev --no-tests=error -j 1 -V -R '^startup_coherent_placed_srv_(warp|hardware)$' on Windows 11 26300.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656, debug layer off. Changing if (dit != dirty_pages.end()) to if (false && dit != dirty_pages.end()) fails on each backend with dirty refresh overwrote the backing before the clean reader finished. The source was restored. Required Windows CI still fails in native_direct_mesh at +0x34: unmapped graphics export, covered by #3851. Please sync and rerun after that fixture fix lands.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6150713488 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776#pullrequestreview-6150713488). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T12:28:18Z. **Review:** APPROVED --- The clean-reader lifetime finding is addressed on `19d2bb33`. The clean path now publishes its reader fence, and a dirty submission checks it before executing. The source-built fixture passes 2/2 with `ctest --preset dev --no-tests=error -j 1 -V -R '^startup_coherent_placed_srv_(warp|hardware)$'` on Windows 11 26300.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656, debug layer off. Changing `if (dit != dirty_pages.end())` to `if (false && dit != dirty_pages.end())` fails on each backend with `dirty refresh overwrote the backing before the clean reader finished`. The source was restored. Required Windows CI still fails in `native_direct_mesh` at `+0x34: unmapped graphics export`, covered by #3851. Please sync and rerun after that fixture fix lands.
Holastor commented 2026-12-02 15:54:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-12-02T15:54:44Z.


@R0Y00 All CI green

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7351133393 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776#issuecomment-7351133393). Originally posted by [Holastor](https://github.com/Holastor) on 2026-12-02T15:54:44Z. --- @R0Y00 All CI green
JB2WIN commented 2026-12-02 20:51:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-12-02T20:51:37Z.


@Holastor since this merged, eight startup compute tests fail on main. They pass with only this PR reverted.

Test On main 46d465d9 main 46d465d9 with 0e29ac07 reverted
startup_compute_dispatch_input_{warp,hardware} fail pass
startup_compute_input_view_token_{warp,hardware} fail pass
startup_compute_root_srv_dispatch_{warp,hardware} fail pass
startup_compute_snapshot_order_{warp,hardware} fail pass

They are not in the pr preset, which is probably why CI stayed green. The first assertions are controls that expect a refusal for an input in a placed buffer that does not alias title memory, for example dispatch-input-copied: a refused Dispatch wrote the output, dispatch-input-token-copied wrote the output, dispatch-root-srv-copied. With the new refresh_range path those inputs are refreshed from title memory and the dispatch runs. snapshot_order now stops on an output buffer descriptor has zero records instead of its expected reason. I haven't traced that one.

If the refresh is the intended behaviour, these controls need new expectations. A refused control could then use a case the refresh still refuses: a GPU-written backing, a non-default heap or an unreadable range. Local, RTX 3080, dev preset: ctest -R 'startup_compute_(dispatch_input|input_view_token|root_srv_dispatch|root_uav_native|snapshot_order)'. The ninth failure, root_uav_native_warp (WARP wave size 4), is unrelated to this PR.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7358431627 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776#issuecomment-7358431627). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-12-02T20:51:37Z. --- @Holastor since this merged, eight startup compute tests fail on `main`. They pass with only this PR reverted. | Test | On `main` 46d465d9 | `main` 46d465d9 with 0e29ac07 reverted | |---|---|---| | `startup_compute_dispatch_input_{warp,hardware}` | fail | pass | | `startup_compute_input_view_token_{warp,hardware}` | fail | pass | | `startup_compute_root_srv_dispatch_{warp,hardware}` | fail | pass | | `startup_compute_snapshot_order_{warp,hardware}` | fail | pass | They are not in the `pr` preset, which is probably why CI stayed green. The first assertions are controls that expect a refusal for an input in a placed buffer that does not alias title memory, for example `dispatch-input-copied: a refused Dispatch wrote the output`, `dispatch-input-token-copied wrote the output`, `dispatch-root-srv-copied`. With the new `refresh_range` path those inputs are refreshed from title memory and the dispatch runs. `snapshot_order` now stops on `an output buffer descriptor has zero records` instead of its expected reason. I haven't traced that one. If the refresh is the intended behaviour, these controls need new expectations. A refused control could then use a case the refresh still refuses: a GPU-written backing, a non-default heap or an unreadable range. Local, RTX 3080, dev preset: `ctest -R 'startup_compute_(dispatch_input|input_view_token|root_srv_dispatch|root_uav_native|snapshot_order)'`. The ninth failure, `root_uav_native_warp` (WARP wave size 4), is unrelated to this PR. AI-assisted.
Leyukaka commented 2026-12-03 07:54:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-03T07:54:26Z.


@Holastor thanks for this work. One observation from full-length application runs: since this merged, every full run stalls when it reaches a later, heavier scene (the presenter's fence wait exceeds 2 s and the process is ended about 30 s later). Bisection shows the stall needs the refreshed bytes themselves: copying the same ranges to a scratch buffer, or writing zeros, does not stall, so the refresh code itself is probably not at fault. #3914 makes the refresh opt-in with X2W_COHERENT_PLACED_REFRESH=1 as a temporary gate that leaves your code unchanged (the 8 compute tests @JB2WIN reported pass again with the switch unset), and we are still working on the root cause, most likely a translated shader doing unbounded work once it reads real constants.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7371574777 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3776#issuecomment-7371574777). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-12-03T07:54:26Z. --- @Holastor thanks for this work. One observation from full-length application runs: since this merged, every full run stalls when it reaches a later, heavier scene (the presenter's fence wait exceeds 2 s and the process is ended about 30 s later). Bisection shows the stall needs the refreshed bytes themselves: copying the same ranges to a scratch buffer, or writing zeros, does not stall, so the refresh code itself is probably not at fault. #3914 makes the refresh opt-in with `X2W_COHERENT_PLACED_REFRESH=1` as a temporary gate that leaves your code unchanged (the 8 compute tests @JB2WIN reported pass again with the switch unset), and we are still working on the root cause, most likely a translated shader doing unbounded work once it reads real constants.
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!3776
No description provided.