startup: write mesh pipeline requests on a background thread #3664

Merged
Jess-Doit merged 8 commits from upstream-pr/3664 into main 2026-12-02 03:17:33 +00:00
Jess-Doit commented 2026-11-30 22:18:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-30T22:18:52Z.


Refs #870, #3541.

Problem

Slot 86. Before it answers, try_cached_mesh86 publishes the request for the key:

  • four parts: .ps86, .root, .stream86 and .m86;
  • each part is a probe, a temporary file and a rename;
  • all of it happens under one function-wide lock (mesh86_cache.inl:228).

A title that creates many mesh pipelines through slot 86 waits on that file work, one creation at a time.

Measured on a package run with X2W_REFUSE_FIXED_MESH=1, where the title builds its mesh pipelines through slot 86 instead of slot 57:

  • The loading screen never ended. The run published 7,056 slot 86 mesh requests in 1,200 s, covering 3,875 distinct MS/PS/root combinations. That is about 7 a second.
  • Thread dumps (X2W_DUMP_AT) at 450, 700 and 950 s each showed 3 or 4 title worker threads queued on that lock, with one thread inside publish_shader_request.
  • The cache directory held about 100,000 files by then.

Details are in #870.

Slot 57. request_slot57_mesh (d3d12_draw.inl) does the same for each new key under its request_lock: .ps57, .root and .m57, plus .s57 with X2W_MESH57_CAPTURE_STATE=1. This is the default path. A run with the shared presets (run_preset.py --console x --gpu nvidia) stopped presenting for about 45 s during the prologue load. Stall dumps at 15 s intervals showed 4 title worker threads queued on that lock, with one thread inside publish_shader_request.

Change

  • New publisher. src/startup_stubs/request_publisher.h copies a request's parts into a queue and returns. One background thread writes them with the existing publish_shader_request.
  • Order. The parts of a request are written in the order given, and requests in the order queued.
  • Repeats. A key is queued once per process. A repeated enqueue copies nothing.
  • Bound. At most 64 MiB of parts wait at a time. A request past that is dropped and counted, and the title asks for it again in a later run.
  • Unload. A request stays at the front of the queue while it is written. At module unload, when the thread is gone, whatever is still queued is written on the unloading thread for at most 2 s. So a short run, such as the mesh cache fixtures, still leaves its request on disk.
  • No thread. If the thread cannot be created, the queuing threads write as before.
  • Both paths share one publisher. It lives next to publish_shader_request in d3d12_draw.inl. publish_mesh_request queues a request, or writes it on the calling thread under the negative control.
  • Slot 57. request_slot57_mesh still checks and updates its written set and the pipeline's stages under its lock, but it only copies the parts into the queue there. A dropped request keeps its stages and is queued again on a later call.
  • try_cached_mesh86 queues the request and then takes its lock only for the marker check and the pipeline build. Until the translator answers, the creation reports the request pending, the same answer it gave before.
  • Reporting. A periodic x2w-render mesh request publisher: line counts queued, repeated, written, failed and dropped requests, and the bytes pending. It is printed only once something has been queued.
  • Negative control. X2W_SYNC_MESH_REQUESTS=1 restores the inline writes under the locks of both paths.
  • Docs. docs/startup-runtime.md has a switch row for it.

Tests

startup_request_publisher checks the header without a device:

Case Expected
Three requests queued while the writer is held on an event all return at once (0 ms here) and nothing is written until the writer is released
Write order the parts and requests come out in queue order
A repeated key accepted and written once
Byte bound a request that would pass it is dropped and counted; the key is accepted once there is room
A failed part stops its request, which counts as failed
drain() writes the queue on the calling thread

startup_request_publisher_inline_control (--mutate inline) waits for each write, as creation did before. It must fail: it takes 1,531 ms to queue the three requests. Both are added to the pr preset.

Verification

Release build of 3f6f4ef9. Host: GTX 1060 6 GB, driver 32.0.15.6094, Windows 10 19045, debug layer off.

Command Result
ctest -R '^startup_request_publisher' 2 passed (the control fails as required)
ctest -R 'request_publisher|mesh86|mesh57|indirect_mesh|shader_cache' 97 passed, 0 failed; the mesh fixtures are capability skips
ctest with the pr preset's selection 92 passed, 0 failed; the skips are capability skips
tests/docs_links_check.py, tests/startup_run_preset_check.py, tests/bidi_controls_check.py, git diff --check pass

The mesh fixtures that publish slot 57 and slot 86 requests (startup_indirect_mesh_*) report a Mesh capability skip on this host, on both WARP and the GTX 1060. They rely on CI's WARP, which runs startup_indirect_mesh_cache_heap(_wide)?_warp in the pr preset. Those fixtures read req_*.m86 after the process exits, so they also exercise the unload drain.

Not measured yet

Whether the title's loading screen completes with X2W_REFUSE_FIXED_MESH=1 and this change. A package run on this host will follow.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5574802956 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-30T22:18:52Z. --- Refs #870, #3541. ## Problem **Slot 86.** Before it answers, `try_cached_mesh86` publishes the request for the key: - four parts: `.ps86`, `.root`, `.stream86` and `.m86`; - each part is a probe, a temporary file and a rename; - all of it happens under one function-wide lock (`mesh86_cache.inl:228`). A title that creates many mesh pipelines through slot 86 waits on that file work, one creation at a time. Measured on a package run with `X2W_REFUSE_FIXED_MESH=1`, where the title builds its mesh pipelines through slot 86 instead of slot 57: - The loading screen never ended. The run published 7,056 slot 86 mesh requests in 1,200 s, covering 3,875 distinct MS/PS/root combinations. That is about 7 a second. - Thread dumps (`X2W_DUMP_AT`) at 450, 700 and 950 s each showed 3 or 4 title worker threads queued on that lock, with one thread inside `publish_shader_request`. - The cache directory held about 100,000 files by then. Details are in [#870](https://github.com/R0Y00/Xbox2Windows/issues/870#issuecomment-7292397053). **Slot 57.** `request_slot57_mesh` (`d3d12_draw.inl`) does the same for each new key under its `request_lock`: `.ps57`, `.root` and `.m57`, plus `.s57` with `X2W_MESH57_CAPTURE_STATE=1`. This is the default path. A run with the shared presets (`run_preset.py --console x --gpu nvidia`) stopped presenting for about 45 s during the prologue load. Stall dumps at 15 s intervals showed 4 title worker threads queued on that lock, with one thread inside `publish_shader_request`. ## Change - **New publisher.** `src/startup_stubs/request_publisher.h` copies a request's parts into a queue and returns. One background thread writes them with the existing `publish_shader_request`. - **Order.** The parts of a request are written in the order given, and requests in the order queued. - **Repeats.** A key is queued once per process. A repeated enqueue copies nothing. - **Bound.** At most 64 MiB of parts wait at a time. A request past that is dropped and counted, and the title asks for it again in a later run. - **Unload.** A request stays at the front of the queue while it is written. At module unload, when the thread is gone, whatever is still queued is written on the unloading thread for at most 2 s. So a short run, such as the mesh cache fixtures, still leaves its request on disk. - **No thread.** If the thread cannot be created, the queuing threads write as before. - **Both paths share one publisher.** It lives next to `publish_shader_request` in `d3d12_draw.inl`. `publish_mesh_request` queues a request, or writes it on the calling thread under the negative control. - **Slot 57.** `request_slot57_mesh` still checks and updates its `written` set and the pipeline's stages under its lock, but it only copies the parts into the queue there. A dropped request keeps its stages and is queued again on a later call. - **`try_cached_mesh86`** queues the request and then takes its lock only for the marker check and the pipeline build. Until the translator answers, the creation reports the request pending, the same answer it gave before. - **Reporting.** A periodic `x2w-render mesh request publisher:` line counts queued, repeated, written, failed and dropped requests, and the bytes pending. It is printed only once something has been queued. - **Negative control.** `X2W_SYNC_MESH_REQUESTS=1` restores the inline writes under the locks of both paths. - **Docs.** `docs/startup-runtime.md` has a switch row for it. ## Tests `startup_request_publisher` checks the header without a device: | Case | Expected | |---|---| | Three requests queued while the writer is held on an event | all return at once (0 ms here) and nothing is written until the writer is released | | Write order | the parts and requests come out in queue order | | A repeated key | accepted and written once | | Byte bound | a request that would pass it is dropped and counted; the key is accepted once there is room | | A failed part | stops its request, which counts as failed | | `drain()` | writes the queue on the calling thread | `startup_request_publisher_inline_control` (`--mutate inline`) waits for each write, as creation did before. It must fail: it takes 1,531 ms to queue the three requests. Both are added to the `pr` preset. ## Verification Release build of `3f6f4ef9`. Host: GTX 1060 6 GB, driver 32.0.15.6094, Windows 10 19045, debug layer off. | Command | Result | |---|---| | `ctest -R '^startup_request_publisher'` | 2 passed (the control fails as required) | | `ctest -R 'request_publisher\|mesh86\|mesh57\|indirect_mesh\|shader_cache'` | 97 passed, 0 failed; the mesh fixtures are capability skips | | `ctest` with the `pr` preset's selection | 92 passed, 0 failed; the skips are capability skips | | `tests/docs_links_check.py`, `tests/startup_run_preset_check.py`, `tests/bidi_controls_check.py`, `git diff --check` | pass | The mesh fixtures that publish slot 57 and slot 86 requests (`startup_indirect_mesh_*`) report a Mesh capability skip on this host, on both WARP and the GTX 1060. They rely on CI's WARP, which runs `startup_indirect_mesh_cache_heap(_wide)?_warp` in the `pr` preset. Those fixtures read `req_*.m86` after the process exits, so they also exercise the unload drain. ## Not measured yet Whether the title's loading screen completes with `X2W_REFUSE_FIXED_MESH=1` and this change. A package run on this host will follow. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Jess-Doit commented 2026-11-30 22:35:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-30T22:35:31Z.


A package run on this branch (1dc77e0e). Host: GTX 1060 6 GB, Windows 10 19045, 22 GiB cap, X2W_REFUSE_FIXED_MESH=1, warm shader cache. These are the same settings as the run in the description, which never left the loading screen.

main (run in the description) this branch
Slot 86 mesh requests asked for 7,056 in 1,200 s, still rising 24,905 by about 594 s, then none
Rate on the loading screen about 7 a second 70–90 a second
Title threads queued on the mesh86 lock (X2W_DUMP_AT=700) 3 or 4 in every dump none
Placed resources after the loading screen starts stop at the menu count past it at about 600 s, 4,056 at 817 s

So the creation no longer waits on the file writes, and the load gets past the point where it stopped. The publisher line at the end showed 19,730 queued, 574 repeated, 16,648 written, 0 failed, 5,175 dropped and 3,082 pending. The 64 MiB bound was full at its high-water mark. Once the burst was over, the writer fell behind, at about 1 to 40 requests a second, while it shared the disk with the title's own streaming. The dropped requests are asked for again in a later run.

At 858 s the title then stopped itself: a deliberate write to address 0 from its own fatal path, not a fault in the stand-in. That happened with every mesh pipeline a placeholder, local video memory at 9.5 GiB against a 5.26 GiB budget, 32 desktop graphics pipeline creations returning null and 4 upload-ring buffer copies failing. That stop is a separate question and needs its own investigation. It does not come from this change: with slot 57 accepted, main on the same host reached the prologue and ran to the 1,200 s limit.

AI-assisted.

Ready for more review

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7294046149 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7294046149). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-30T22:35:31Z. --- A package run on this branch (`1dc77e0e`). Host: GTX 1060 6 GB, Windows 10 19045, 22 GiB cap, `X2W_REFUSE_FIXED_MESH=1`, warm shader cache. These are the same settings as the run in the description, which never left the loading screen. | | `main` (run in the description) | this branch | |---|---|---| | Slot 86 mesh requests asked for | 7,056 in 1,200 s, still rising | 24,905 by about 594 s, then none | | Rate on the loading screen | about 7 a second | 70–90 a second | | Title threads queued on the mesh86 lock (`X2W_DUMP_AT=700`) | 3 or 4 in every dump | none | | Placed resources after the loading screen starts | stop at the menu count | past it at about 600 s, 4,056 at 817 s | So the creation no longer waits on the file writes, and the load gets past the point where it stopped. The publisher line at the end showed 19,730 queued, 574 repeated, 16,648 written, 0 failed, 5,175 dropped and 3,082 pending. The 64 MiB bound was full at its high-water mark. Once the burst was over, the writer fell behind, at about 1 to 40 requests a second, while it shared the disk with the title's own streaming. The dropped requests are asked for again in a later run. At 858 s the title then stopped itself: a deliberate write to address 0 from its own fatal path, not a fault in the stand-in. That happened with every mesh pipeline a placeholder, local video memory at 9.5 GiB against a 5.26 GiB budget, 32 desktop graphics pipeline creations returning null and 4 upload-ring buffer copies failing. That stop is a separate question and needs its own investigation. It does not come from this change: with slot 57 accepted, `main` on the same host reached the prologue and ran to the 1,200 s limit. AI-assisted. Ready for more review
Jess-Doit commented 2026-11-30 23:52:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-30T23:52:41Z.


Updated to 3f6f4ef9. The slot 57 path has the same problem, so this now covers both paths:

  • request_slot57_mesh wrote .ps57, .root and .m57 for each new key under its request_lock. A run with the shared presets (below) stopped presenting for about 45 s during the prologue load. Stall dumps showed 4 title worker threads queued on that lock, with one inside publish_shader_request.
  • The publisher moved next to publish_shader_request and serves both paths through publish_mesh_request. A dropped slot 57 request keeps its stages and is queued again on a later call.
  • The negative control is renamed X2W_SYNC_MESH_REQUESTS=1 and covers both paths. The description is updated to match.
  • Release build tests: request_publisher|mesh86|mesh57|indirect_mesh|shader_cache gave 97 passed and 0 failed. The pr selection gave 92 passed and 0 failed. The mesh fixtures are capability skips on this host.

A correction to my run numbers. The runs in the description and in my previous comment were started with an older hand-written run.ps1 line, not tools/startup/run_preset.py. That line left out -SuspendOthers 0, X2W_PROBE_PRECHECK=0, X2W_D3D12_RELEASE_RETIRED=1 and the other preset settings. With the presets on this branch, same host:

  • The intro video and menus are smooth, where the old line gave choppy video and audio.
  • The loading screen appeared at 92 s instead of about 200 s.

The slot 86 finding does not depend on those settings: it is the lock around the file writes. The rate of about 7 a second was measured with the old line, though.

The 858 s stop in that comment is not specific to this change. With the presets and slot 57 accepted (main behaviour), the title reached the prologue and the device was then removed at 517 s. Details are on #870.

AI-assisted.

Ready for more review

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7295627383 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7295627383). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-30T23:52:41Z. --- Updated to `3f6f4ef9`. The slot 57 path has the same problem, so this now covers both paths: - `request_slot57_mesh` wrote `.ps57`, `.root` and `.m57` for each new key under its `request_lock`. A run with the shared presets (below) stopped presenting for about 45 s during the prologue load. Stall dumps showed 4 title worker threads queued on that lock, with one inside `publish_shader_request`. - The publisher moved next to `publish_shader_request` and serves both paths through `publish_mesh_request`. A dropped slot 57 request keeps its stages and is queued again on a later call. - The negative control is renamed `X2W_SYNC_MESH_REQUESTS=1` and covers both paths. The description is updated to match. - Release build tests: `request_publisher|mesh86|mesh57|indirect_mesh|shader_cache` gave 97 passed and 0 failed. The `pr` selection gave 92 passed and 0 failed. The mesh fixtures are capability skips on this host. **A correction to my run numbers.** The runs in the description and in my previous comment were started with an older hand-written `run.ps1` line, not `tools/startup/run_preset.py`. That line left out `-SuspendOthers 0`, `X2W_PROBE_PRECHECK=0`, `X2W_D3D12_RELEASE_RETIRED=1` and the other preset settings. With the presets on this branch, same host: - The intro video and menus are smooth, where the old line gave choppy video and audio. - The loading screen appeared at 92 s instead of about 200 s. The slot 86 finding does not depend on those settings: it is the lock around the file writes. The rate of about 7 a second was measured with the old line, though. The 858 s stop in that comment is not specific to this change. With the presets and slot 57 accepted (`main` behaviour), the title reached the prologue and the device was then removed at 517 s. Details are on #870. AI-assisted. Ready for more review
Leyukaka commented 2026-12-01 00:04:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-01T00:04:10Z.

Review: COMMENTED


Read at 3f6f4ef9.

  • SHOULD The exit drain takes blocking locks that terminated threads may hold. In d3d12_xs.dll, ~MeshRequestDrain (src/startup_stubs/d3d12_draw.inl:620-625) runs at DLL_PROCESS_DETACH, after ExitProcess has terminated every other thread. drain() takes the publisher lock with TryAcquireSRWLockExclusive (src/startup_stubs/request_publisher.h:117), but each part then goes through publish_shader_request. That function calls cache_absent and note_cache_write (d3d12_draw.inl:570, :580), which acquire CacheDirectoryIndex::lock_ without a try (src/startup_stubs/cache_index.h:260, :281). The writer thread (add_hash, :281) and the change-feed thread (note_key_change, :268) hold that lock exclusively. If either was terminated while holding it, the acquire can never be granted, so the drain cannot complete and the process does not exit cleanly. Two smaller points on the same path:

    • A writer terminated between CreateFileW and CloseHandle leaves req_<key><ext>.<pid>.tmp open with share mode 0 (d3d12_draw.inl:572-574). The drain rewrites the same front request with the same name, gets a sharing violation, and counts it failed.
    • mesh_request_publisher() allocates the publisher during the drain when no mesh request was ever queued (:612-616, :623).

    An explicit flush before exit, for example flush() from a fixture export, would avoid file and lock work at detach. So would a drain that skips the cache index.

  • SHOULD The test publishers live on the stack and are never stopped. held_writer() and failed_part() (tests/startup_request_publisher_check.cpp:73, :116) return while their writer thread is still in run(), which has no exit (request_publisher.h:171-183). That thread keeps waiting on work_ and lock_ in a dead frame, with context_ pointing to a destroyed Writer. In the stand-in the publisher is leaked on purpose, so this affects only the test. A stop-and-join path, or leaked test instances, would remove the undefined behaviour.

  • NIT drain() assumes the writer thread is already gone. That holds in the DLL. It does not hold in an executable that links d3d12_xs_device.cpp directly (offscreen_check, CMakeLists.txt:2247): there, static destructors run from exit() while the writer may be inside write_front with the lock released. Two threads would then pop the same queue (request_publisher.h:150-162).

  • NIT A failed write is no longer retried in the same process. seen_ is set at enqueue (request_publisher.h:77), and slot 57 marks the key written as soon as it is queued (d3d12_draw.inl:1136-1137). Before this change, both slots retried a failed publication on the next creation.

The branch conflicts with main on CMakePresets.json, so no CI has run at this head.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6122772865 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#pullrequestreview-6122772865). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-12-01T00:04:10Z. **Review:** COMMENTED --- Read at `3f6f4ef9`. - **SHOULD** The exit drain takes blocking locks that terminated threads may hold. In `d3d12_xs.dll`, `~MeshRequestDrain` (`src/startup_stubs/d3d12_draw.inl:620-625`) runs at `DLL_PROCESS_DETACH`, after `ExitProcess` has terminated every other thread. `drain()` takes the publisher lock with `TryAcquireSRWLockExclusive` (`src/startup_stubs/request_publisher.h:117`), but each part then goes through `publish_shader_request`. That function calls `cache_absent` and `note_cache_write` (`d3d12_draw.inl:570`, `:580`), which acquire `CacheDirectoryIndex::lock_` without a try (`src/startup_stubs/cache_index.h:260`, `:281`). The writer thread (`add_hash`, `:281`) and the change-feed thread (`note_key_change`, `:268`) hold that lock exclusively. If either was terminated while holding it, the acquire can never be granted, so the drain cannot complete and the process does not exit cleanly. Two smaller points on the same path: - A writer terminated between `CreateFileW` and `CloseHandle` leaves `req_<key><ext>.<pid>.tmp` open with share mode 0 (`d3d12_draw.inl:572-574`). The drain rewrites the same front request with the same name, gets a sharing violation, and counts it failed. - `mesh_request_publisher()` allocates the publisher during the drain when no mesh request was ever queued (`:612-616`, `:623`). An explicit flush before exit, for example `flush()` from a fixture export, would avoid file and lock work at detach. So would a drain that skips the cache index. - **SHOULD** The test publishers live on the stack and are never stopped. `held_writer()` and `failed_part()` (`tests/startup_request_publisher_check.cpp:73`, `:116`) return while their writer thread is still in `run()`, which has no exit (`request_publisher.h:171-183`). That thread keeps waiting on `work_` and `lock_` in a dead frame, with `context_` pointing to a destroyed `Writer`. In the stand-in the publisher is leaked on purpose, so this affects only the test. A stop-and-join path, or leaked test instances, would remove the undefined behaviour. - **NIT** `drain()` assumes the writer thread is already gone. That holds in the DLL. It does not hold in an executable that links `d3d12_xs_device.cpp` directly (`offscreen_check`, `CMakeLists.txt:2247`): there, static destructors run from `exit()` while the writer may be inside `write_front` with the lock released. Two threads would then pop the same queue (`request_publisher.h:150-162`). - **NIT** A failed write is no longer retried in the same process. `seen_` is set at enqueue (`request_publisher.h:77`), and slot 57 marks the key `written` as soon as it is queued (`d3d12_draw.inl:1136-1137`). Before this change, both slots retried a failed publication on the next creation. The branch conflicts with `main` on `CMakePresets.json`, so no CI has run at this head.
R0Y00 commented 2026-12-01 00:14:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T00:14:11Z.

Review: COMMENTED


The current head conflicts with main in CMakePresets.json. Please merge or rebase onto current main and keep both the existing PR preset cases and the request publisher target and controls. Once CI can run, the review can verify that publishing stays off the creation thread and that the inline control observes the same completed request.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6122877433 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#pullrequestreview-6122877433). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-01T00:14:11Z. **Review:** COMMENTED --- The current head conflicts with `main` in `CMakePresets.json`. Please merge or rebase onto current `main` and keep both the existing PR preset cases and the request publisher target and controls. Once CI can run, the review can verify that publishing stays off the creation thread and that the inline control observes the same completed request.
Jess-Doit commented 2026-12-01 00:59:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-12-01T00:59:48Z.


Thanks, both. Rebased onto main a3bfd019 and squashed into one commit (6752ce8d). The pr preset keeps main's cases and adds the publisher target and its controls. On top of that, d6988e4b addresses the review:

  • Exit drain: it no longer goes through publish_shader_request. It writes with its own unload writer: a .<pid>.exit.tmp name of its own, then a rename. There is no cache index, so no CacheDirectoryIndex::lock_, and it takes the cache directory captured when the publisher was made, so no environment read. It runs only once the writer thread has ended. While the thread still runs, as with an executable's static destructors, it waits for the thread instead, so the queue is never popped twice. Nothing is allocated at unload when no request was ever queued.
  • Test publishers: they now stop and join. stop() ends the thread after its current request, the destructor calls it, and the thread is created suspended so its handle is always known.
  • Retry: a request that could not be written forgets its key, so slot 86 queues it again on the next creation. Slot 57 releases a request's stages once it is queued, so a failed slot 57 write comes back only in a later run. That is stated in the code comment.
  • Tests: the check now also covers the retry, the unload writer, a drain while the thread runs, and a stopped publisher. Locally: passes 30 out of 30 runs with no hang, and the inline control still fails (1,547 ms to queue three requests).

AI-assisted.

Ready for more review

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7296971056 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7296971056). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-12-01T00:59:48Z. --- Thanks, both. Rebased onto `main` `a3bfd019` and squashed into one commit (`6752ce8d`). The `pr` preset keeps main's cases and adds the publisher target and its controls. On top of that, `d6988e4b` addresses the review: - **Exit drain:** it no longer goes through `publish_shader_request`. It writes with its own unload writer: a `.<pid>.exit.tmp` name of its own, then a rename. There is no cache index, so no `CacheDirectoryIndex::lock_`, and it takes the cache directory captured when the publisher was made, so no environment read. It runs only once the writer thread has ended. While the thread still runs, as with an executable's static destructors, it waits for the thread instead, so the queue is never popped twice. Nothing is allocated at unload when no request was ever queued. - **Test publishers:** they now stop and join. `stop()` ends the thread after its current request, the destructor calls it, and the thread is created suspended so its handle is always known. - **Retry:** a request that could not be written forgets its key, so slot 86 queues it again on the next creation. Slot 57 releases a request's stages once it is queued, so a failed slot 57 write comes back only in a later run. That is stated in the code comment. - **Tests:** the check now also covers the retry, the unload writer, a drain while the thread runs, and a stopped publisher. Locally: passes 30 out of 30 runs with no hang, and the inline control still fails (1,547 ms to queue three requests). AI-assisted. Ready for more review
R0Y00 commented 2026-12-01 01:12:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T01:12:32Z.

Review: CHANGES_REQUESTED


I reproduced Windows CI's C2664 on this head with MSVC 14.51. All five std::begin({RequestPublisher::Part{...}}) calls in the fixture fail to compile. Passing the address of a named const Part and a count of 1 fixes the build in an isolated probe. The normal test passed, and --mutate inline failed its held-writer assertion as expected.

Please also keep seen_ and queue_ consistent on enqueue failure. If queue_.push_back throws after seen_.insert succeeds, the catch reports a drop but leaves the key in seen_. A retry then reports success without publishing the request. Roll back the key on this failure and add a retry control.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6123413516 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#pullrequestreview-6123413516). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-01T01:12:32Z. **Review:** CHANGES_REQUESTED --- I reproduced Windows CI's C2664 on this head with MSVC 14.51. All five `std::begin({RequestPublisher::Part{...}})` calls in the fixture fail to compile. Passing the address of a named `const Part` and a count of 1 fixes the build in an isolated probe. The normal test passed, and `--mutate inline` failed its held-writer assertion as expected. Please also keep `seen_` and `queue_` consistent on enqueue failure. If `queue_.push_back` throws after `seen_.insert` succeeds, the catch reports a drop but leaves the key in `seen_`. A retry then reports success without publishing the request. Roll back the key on this failure and add a retry control.
R0Y00 commented 2026-12-01 01:12:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T01:12:32Z.

Code review location: src/startup_stubs/request_publisher.h; line 82

@@ -0,0 +1,263 @@
+// Experimental (docs/startup-runtime.md): writes shader-cache request parts on one background thread.
+//
+// A mesh pipeline creation publishes its request (several parts, each a probe, a temporary file and a rename) before
+// it can answer. A title that creates thousands of mesh pipelines then waits on that file work, one creation at a
+// time. The publisher takes a copy of a request's parts and returns; its thread writes them.
+//
+// - The parts of one request are written in the order given, and requests in the order queued.
+// - A key is queued once per process. A repeated enqueue of it returns true without copying anything. A request that
+//   could not be written forgets its key, so a later enqueue of it is accepted again.
+// - The queued bytes are bounded. A request that would pass the bound is dropped and counted.
+// - stop() ends the thread and joins it (the destructor calls it).
+// - drain() is for module unload: it writes what is still queued on the calling thread, with its own writer (one that
+//   takes no lock a terminated thread may hold), and only once the writer thread has ended. While the thread still
+//   runs (an executable's static destructors) it waits for the thread instead. A request stays at the front of the
+//   queue while it is written, so a drain after the thread was terminated mid-write writes it again from the start.
+#pragma once
+
+#include <windows.h>
+
+#include <cstddef>
+#include <cstdint>
+#include <deque>
+#include <string>
+#include <unordered_set>
+#include <utility>
+#include <vector>
+
+namespace x2w_startup {
+
+class RequestPublisher {
+public:
+    // Writes one part; returns false when the part could not be written.
+    using Write = bool (*)(void* context, std::uint64_t key, const wchar_t* extension, const void* data, std::size_t bytes);
+
+    struct Part {
+        const wchar_t* extension;
+        const void* data;
+        std::size_t bytes;
+    };
+
+    struct Stats {
+        long long queued = 0;    // requests accepted
+        long long repeated = 0;  // enqueues of a key already accepted
+        long long written = 0;   // requests whose parts were all written
+        long long failed = 0;    // requests with a part that could not be written
+        long long dropped = 0;   // requests over the byte bound
+        std::size_t pending = 0, pending_bytes = 0, high_water_bytes = 0;
+    };
+
+    RequestPublisher(Write write, void* context, std::size_t byte_limit, bool start_thread = true) noexcept
+        : write_(write), context_(context), byte_limit_(byte_limit), start_thread_(start_thread)
+    {
+    }
+    RequestPublisher(const RequestPublisher&) = delete;
+    RequestPublisher& operator=(const RequestPublisher&) = delete;
+    ~RequestPublisher() { stop(); }
+
+    // Copies the parts and queues them as one request. False when the request was dropped (or out of memory).
+    bool enqueue(std::uint64_t key, const Part* parts, std::size_t count)
+    {
+        std::size_t bytes = 0;
+        for (std::size_t i = 0; i < count; ++i) bytes += parts[i].bytes;
+        AcquireSRWLockExclusive(&lock_);
+        if (seen_.count(key)) {
+            ++stats_.repeated;
+            ReleaseSRWLockExclusive(&lock_);
+            return true;
+        }
+        if (stopping_ || bytes > byte_limit_ || stats_.pending_bytes > byte_limit_ - bytes) {
+            ++stats_.dropped;
+            ReleaseSRWLockExclusive(&lock_);
+            return false;
+        }
+        try {
+            Request request{key, bytes, {}};
+            request.parts.reserve(count);
+            for (std::size_t i = 0; i < count; ++i) {
+                const auto* begin = static_cast<const unsigned char*>(parts[i].data);
+                request.parts.push_back({parts[i].extension, std::vector<unsigned char>(begin, begin + parts[i].bytes)});
+            }
+            seen_.insert(key);
+            queue_.push_back(std::move(request));

An allocation failure here leaves the key in seen_. The next enqueue of the same key returns success before it reaches the queue. Roll the insert back if this push fails.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4747849970 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#discussion_r4747849970). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-01T01:12:32Z. **Code review location:** `src/startup_stubs/request_publisher.h`; line 82 ~~~~diff @@ -0,0 +1,263 @@ +// Experimental (docs/startup-runtime.md): writes shader-cache request parts on one background thread. +// +// A mesh pipeline creation publishes its request (several parts, each a probe, a temporary file and a rename) before +// it can answer. A title that creates thousands of mesh pipelines then waits on that file work, one creation at a +// time. The publisher takes a copy of a request's parts and returns; its thread writes them. +// +// - The parts of one request are written in the order given, and requests in the order queued. +// - A key is queued once per process. A repeated enqueue of it returns true without copying anything. A request that +// could not be written forgets its key, so a later enqueue of it is accepted again. +// - The queued bytes are bounded. A request that would pass the bound is dropped and counted. +// - stop() ends the thread and joins it (the destructor calls it). +// - drain() is for module unload: it writes what is still queued on the calling thread, with its own writer (one that +// takes no lock a terminated thread may hold), and only once the writer thread has ended. While the thread still +// runs (an executable's static destructors) it waits for the thread instead. A request stays at the front of the +// queue while it is written, so a drain after the thread was terminated mid-write writes it again from the start. +#pragma once + +#include <windows.h> + +#include <cstddef> +#include <cstdint> +#include <deque> +#include <string> +#include <unordered_set> +#include <utility> +#include <vector> + +namespace x2w_startup { + +class RequestPublisher { +public: + // Writes one part; returns false when the part could not be written. + using Write = bool (*)(void* context, std::uint64_t key, const wchar_t* extension, const void* data, std::size_t bytes); + + struct Part { + const wchar_t* extension; + const void* data; + std::size_t bytes; + }; + + struct Stats { + long long queued = 0; // requests accepted + long long repeated = 0; // enqueues of a key already accepted + long long written = 0; // requests whose parts were all written + long long failed = 0; // requests with a part that could not be written + long long dropped = 0; // requests over the byte bound + std::size_t pending = 0, pending_bytes = 0, high_water_bytes = 0; + }; + + RequestPublisher(Write write, void* context, std::size_t byte_limit, bool start_thread = true) noexcept + : write_(write), context_(context), byte_limit_(byte_limit), start_thread_(start_thread) + { + } + RequestPublisher(const RequestPublisher&) = delete; + RequestPublisher& operator=(const RequestPublisher&) = delete; + ~RequestPublisher() { stop(); } + + // Copies the parts and queues them as one request. False when the request was dropped (or out of memory). + bool enqueue(std::uint64_t key, const Part* parts, std::size_t count) + { + std::size_t bytes = 0; + for (std::size_t i = 0; i < count; ++i) bytes += parts[i].bytes; + AcquireSRWLockExclusive(&lock_); + if (seen_.count(key)) { + ++stats_.repeated; + ReleaseSRWLockExclusive(&lock_); + return true; + } + if (stopping_ || bytes > byte_limit_ || stats_.pending_bytes > byte_limit_ - bytes) { + ++stats_.dropped; + ReleaseSRWLockExclusive(&lock_); + return false; + } + try { + Request request{key, bytes, {}}; + request.parts.reserve(count); + for (std::size_t i = 0; i < count; ++i) { + const auto* begin = static_cast<const unsigned char*>(parts[i].data); + request.parts.push_back({parts[i].extension, std::vector<unsigned char>(begin, begin + parts[i].bytes)}); + } + seen_.insert(key); + queue_.push_back(std::move(request)); ~~~~ --- An allocation failure here leaves the key in `seen_`. The next enqueue of the same key returns success before it reaches the queue. Roll the insert back if this push fails.
R0Y00 commented 2026-12-01 03:10:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T03:10:02Z.

Review: COMMENTED


Retested 9efad1d2 with MSVC 14.51. The named-part fix builds, the request publisher test passes, and the inline mutation fails the held-writer control as expected.

I reproduced the retry issue on this head by injecting std::bad_alloc after three successful allocations during the first enqueue. The call reported a drop, then a retry of the same key returned success with queued=0. With seen_.erase(key) in the enqueue catch under the existing lock, all 205 injected allocation-failure retries in my probe queued successfully. Please add that rollback and a retry control. The current main merge still conflicts in CMakePresets.json.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6124485481 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#pullrequestreview-6124485481). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-01T03:10:02Z. **Review:** COMMENTED --- Retested `9efad1d2` with MSVC 14.51. The named-part fix builds, the request publisher test passes, and the inline mutation fails the held-writer control as expected. I reproduced the retry issue on this head by injecting `std::bad_alloc` after three successful allocations during the first `enqueue`. The call reported a drop, then a retry of the same key returned success with `queued=0`. With `seen_.erase(key)` in the enqueue catch under the existing lock, all 205 injected allocation-failure retries in my probe queued successfully. Please add that rollback and a retry control. The current `main` merge still conflicts in `CMakePresets.json`.
Jess-Doit commented 2026-12-01 03:49:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-12-01T03:49:07Z.


Thanks for the probe. Pushed 9ceb1f44:

  • enqueue now erases the key in its catch, under the same lock, so a copy that runs out of memory leaves the key unrecorded and a retry is queued.
  • tests/startup_request_publisher_check.cpp adds allocation_failure_retry. A per-thread operator new hook in the test fails each allocation of an enqueue in turn (the writer thread is unaffected), from the first allocation until the enqueue no longer fails. Each failure must count one drop, and the retry of the same key must be queued (not counted as repeated) and later written.
  • Control: with the seen_.erase(key) line removed, that case fails with FAIL a retry after an allocation failure queues the request; with it, all cases pass. The inline mutation still fails the held-writer case as before.
  • Rebased on current main (1c634037). The CMakePresets.json conflict kept main's list and appended startup_request_publisher(_inline_control)?.

Release build of d3d12_xs_shim and startup_request_publisher_check on Windows 10 19045, MSVC 2022 Build Tools:

ctest --preset release --no-tests=error -R '^startup_request_publisher'
1/2 startup_request_publisher ................ Passed
2/2 startup_request_publisher_inline_control . Passed (WILL_FAIL)

Ready for more review

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7300093810 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7300093810). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-12-01T03:49:07Z. --- Thanks for the probe. Pushed `9ceb1f44`: - `enqueue` now erases the key in its catch, under the same lock, so a copy that runs out of memory leaves the key unrecorded and a retry is queued. - `tests/startup_request_publisher_check.cpp` adds `allocation_failure_retry`. A per-thread `operator new` hook in the test fails each allocation of an enqueue in turn (the writer thread is unaffected), from the first allocation until the enqueue no longer fails. Each failure must count one drop, and the retry of the same key must be queued (not counted as repeated) and later written. - Control: with the `seen_.erase(key)` line removed, that case fails with `FAIL a retry after an allocation failure queues the request`; with it, all cases pass. The inline mutation still fails the held-writer case as before. - Rebased on current `main` (`1c634037`). The `CMakePresets.json` conflict kept main's list and appended `startup_request_publisher(_inline_control)?`. Release build of `d3d12_xs_shim` and `startup_request_publisher_check` on Windows 10 19045, MSVC 2022 Build Tools: ``` ctest --preset release --no-tests=error -R '^startup_request_publisher' 1/2 startup_request_publisher ................ Passed 2/2 startup_request_publisher_inline_control . Passed (WILL_FAIL) ``` Ready for more review
R0Y00 commented 2026-12-01 08:43:43 +00:00 (Migrated from github.com)

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

Review: APPROVED


The current head erases the deduplication key under the enqueue lock and adds retry coverage. The MSVC 14.51 /O2 fixture passed, its inline mutant failed the held-writer assertion, and my independent fault-injection probe queued all 205 retries. This resolves my change request.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6127743960 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#pullrequestreview-6127743960). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-01T08:43:43Z. **Review:** APPROVED --- The current head erases the deduplication key under the enqueue lock and adds retry coverage. The MSVC 14.51 /O2 fixture passed, its inline mutant failed the held-writer assertion, and my independent fault-injection probe queued all 205 retries. This resolves my change request.
Jess-Doit commented 2026-12-01 08:44:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-12-01T08:44:39Z.


Thanks for the retest and the independent fault-injection probe.

Ready to merge from our side

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7305720937 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7305720937). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-12-01T08:44:39Z. --- Thanks for the retest and the independent fault-injection probe. Ready to merge from our side
R0Y00 commented 2026-12-01 08:48:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T08:48:03Z.

Review: CHANGES_REQUESTED


The enqueue rollback passes, but the full integration exposed a Slot 57 regression. startup_mesh57_runtime_warp failed on the first run twice with the async default, and passed 3/3 with X2W_SYNC_MESH_REQUESTS=1 on the same binaries. In tests/startup_indirect_draw_indexed.cpp the exchange fixture enumerates the cache immediately after the dispatches and requires exactly two requests and six files. Please make the async fixture wait for both complete request markers with a bounded timeout before checking the existing exact bytes and file counts. Keep the async default in that coverage.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6127812079 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#pullrequestreview-6127812079). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-01T08:48:03Z. **Review:** CHANGES_REQUESTED --- The enqueue rollback passes, but the full integration exposed a Slot 57 regression. startup_mesh57_runtime_warp failed on the first run twice with the async default, and passed 3/3 with X2W_SYNC_MESH_REQUESTS=1 on the same binaries. In tests/startup_indirect_draw_indexed.cpp the exchange fixture enumerates the cache immediately after the dispatches and requires exactly two requests and six files. Please make the async fixture wait for both complete request markers with a bounded timeout before checking the existing exact bytes and file counts. Keep the async default in that coverage.
Jess-Doit commented 2026-12-01 09:04:50 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-12-01T09:04:50Z.


Thanks, reproduced. Pushed b64d3b06 (rebased on a061032f).

tests/startup_indirect_draw_indexed.cpp: after the dispatches, the exchange fixture now waits, for at most 10 s, until both .m57 ready markers exist and no part is still under its .tmp name, then runs the unchanged exact byte, root and count checks (two requests, one with a PS, six files). The async default is kept; a timeout prints FAIL: the two slot 57 requests were not complete within 10 s.

Measured on Windows 10 19045, MSVC 2022 Build Tools, app-local WARP 1.0.22 with Agility SDK 1.620.2 (a separate build with OFFSCREEN_AGILITY_620_DIR and OFFSCREEN_WARP_DIR; the in-box WARP here has no mesh shaders, so startup_mesh57_runtime_warp skips with 77 there), async default:

  • with the wait: the request half printed slot 57 MS+PS and MS-only requests preserved stages and the matching root in 10 of 10 runs;
  • control, the same binary with the wait removed: 0 of 10.

On this host the test then fails later, at published pair without opt-in: runtime fixture exited 3 with a D3D12 debug-layer warning or error. That happens with X2W_SYNC_MESH_REQUESTS=1 as well, so it does not depend on the publisher, and I take it as specific to this WARP/Agility/Windows 10 combination. Your run on your host is the check for that half.

Ready for more review

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7306185002 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7306185002). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-12-01T09:04:50Z. --- Thanks, reproduced. Pushed `b64d3b06` (rebased on `a061032f`). `tests/startup_indirect_draw_indexed.cpp`: after the dispatches, the exchange fixture now waits, for at most 10 s, until both `.m57` ready markers exist and no part is still under its `.tmp` name, then runs the unchanged exact byte, root and count checks (two requests, one with a PS, six files). The async default is kept; a timeout prints `FAIL: the two slot 57 requests were not complete within 10 s`. Measured on Windows 10 19045, MSVC 2022 Build Tools, app-local WARP 1.0.22 with Agility SDK 1.620.2 (a separate build with `OFFSCREEN_AGILITY_620_DIR` and `OFFSCREEN_WARP_DIR`; the in-box WARP here has no mesh shaders, so `startup_mesh57_runtime_warp` skips with 77 there), async default: - with the wait: the request half printed `slot 57 MS+PS and MS-only requests preserved stages and the matching root` in 10 of 10 runs; - control, the same binary with the wait removed: 0 of 10. On this host the test then fails later, at `published pair without opt-in: runtime fixture exited 3` with a D3D12 debug-layer warning or error. That happens with `X2W_SYNC_MESH_REQUESTS=1` as well, so it does not depend on the publisher, and I take it as specific to this WARP/Agility/Windows 10 combination. Your run on your host is the check for that half. Ready for more review
R0Y00 commented 2026-12-01 11:21:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T11:21:44Z.

Review: APPROVED


Re-tested this exact head with X2W_SYNC_MESH_REQUESTS=0. Both startup_request_publisher tests passed. startup_mesh57_runtime_warp passed once in the integrated suite and three consecutive repeats, and startup_mesh57_runtime_hardware passed on RTX 4060 Laptop (616.56, Windows build 26300). The bounded wait covers both ready markers and preserves the existing count and byte checks.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6130214952 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#pullrequestreview-6130214952). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-01T11:21:44Z. **Review:** APPROVED --- Re-tested this exact head with X2W_SYNC_MESH_REQUESTS=0. Both startup_request_publisher tests passed. startup_mesh57_runtime_warp passed once in the integrated suite and three consecutive repeats, and startup_mesh57_runtime_hardware passed on RTX 4060 Laptop (616.56, Windows build 26300). The bounded wait covers both ready markers and preserves the existing count and byte checks.
Jess-Doit commented 2026-12-01 11:24:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-12-01T11:24:30Z.


Thanks for the retest on both adapters.

Ready to merge from our side

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7309598610 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7309598610). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-12-01T11:24:30Z. --- Thanks for the retest on both adapters. Ready to merge from our side
Jess-Doit commented 2026-12-01 21:47:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-12-01T21:47:20Z.


The Windows job was timing out at 30 minutes, which was a hang in the new startup_request_publisher test under the Debug (dev) build. The out-of-memory injection made the next operator new throw, and in Debug that call can be the iterator proxy that MSVC containers allocate inside noexcept constructors. The throw then reached std::terminate, and the CRT's modal report dialog waited until the job limit. Release builds never allocate the proxy, so they passed locally.

  • 1319a11f: the test's operator new neither fails nor counts allocations of sizeof(std::_Container_proxy) when _ITERATOR_DEBUG_LEVEL != 0. The publisher code is unchanged.
  • Also rebased onto current main (no conflicts).

Checks:

  • Debug (cl /Od /MDd): all cases pass, and --mutate inline still fails as expected.
  • Release: startup_request_publisher and _inline_control pass.
  • CI on 1319a11f: Windows build and test, gfx1013 fixtures, and Linux Python checks all pass.

Ready to merge from our side

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7326782423 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7326782423). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-12-01T21:47:20Z. --- The Windows job was timing out at 30 minutes, which was a hang in the new `startup_request_publisher` test under the Debug (`dev`) build. The out-of-memory injection made the next `operator new` throw, and in Debug that call can be the iterator proxy that MSVC containers allocate inside `noexcept` constructors. The throw then reached `std::terminate`, and the CRT's modal report dialog waited until the job limit. Release builds never allocate the proxy, so they passed locally. - 1319a11f: the test's `operator new` neither fails nor counts allocations of `sizeof(std::_Container_proxy)` when `_ITERATOR_DEBUG_LEVEL != 0`. The publisher code is unchanged. - Also rebased onto current main (no conflicts). Checks: - Debug (`cl /Od /MDd`): all cases pass, and `--mutate inline` still fails as expected. - Release: `startup_request_publisher` and `_inline_control` pass. - CI on 1319a11f: Windows build and test, gfx1013 fixtures, and Linux Python checks all pass. Ready to merge from our side
R0Y00 commented 2026-12-02 02:54:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T02:54:46Z.


Pushed merge resolution e6e92bd0 to this PR's maintainer-editable branch, preserving the original commits and both main's shared-heap and this PR's publisher targets and filters. git merge-tree --write-tree review-latest HEAD succeeds against main 2b870868. Compiled startup_request_publisher_check.cpp with MSVC /O2 and ran the fixture: pass, with 0 ms to queue three requests while the writer was blocked. The --mutate inline control returned 1 as expected. The integrated Windows run is pending on the new head.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7333327165 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7333327165). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T02:54:46Z. --- Pushed merge resolution `e6e92bd0` to this PR's maintainer-editable branch, preserving the original commits and both main's shared-heap and this PR's publisher targets and filters. `git merge-tree --write-tree review-latest HEAD` succeeds against main `2b870868`. Compiled `startup_request_publisher_check.cpp` with MSVC `/O2` and ran the fixture: pass, with 0 ms to queue three requests while the writer was blocked. The `--mutate inline` control returned 1 as expected. The integrated Windows run is pending on the new head.
R0Y00 commented 2026-12-02 03:13:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T03:13:12Z.


After #3770 landed, b9288115 resolves the new preset overlap and keeps the shared-heap, typed-V# and request-publisher targets and filters. No publisher source changed in this update. The original PR head now needs its new integrated CI run.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7333659608 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3664#issuecomment-7333659608). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T03:13:12Z. --- After #3770 landed, `b9288115` resolves the new preset overlap and keeps the shared-heap, typed-V# and request-publisher targets and filters. No publisher source changed in this update. The original PR head now needs its new integrated CI run.
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!3664
No description provided.