runtime: recover the published disk pair when native candidate PSO creation fails #3139

Merged
lambirou merged 9 commits from upstream-pr/3139 into codex/native-graphics-integration 2026-11-28 17:58:35 +00:00
lambirou commented 2026-11-27 17:02:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T17:02:37Z.


Change A native graphics candidate marked the translation ready before pipeline_for created its desktop PSO. When CreateGraphicsPipelineState failed, the draw returned null and cached that null, so the target stayed clear even when a valid published disk pair existed. With candidate PSO creation forced to E_FAIL, the target read 0 red / 32 clear; the disk pair alone drew 16 red / 16 clear. The candidate now records native_candidate, revision and rtv_request. On a candidate PSO failure the runtime reloads the published pair for the same key and RTV variant, recomputes the PSO with a bumped revision (so earlier native PSOs are not reused), and refuses with a diagnostic when the pair is missing or invalid or its disk PSO fails. X2W_NATIVE_SHADERS_ONLY=1 keeps its explicit refusal without a fallback. The published manifest and stage files are read, never rewritten. Refs #3134. Refs #3094. Targets codex/native-graphics-integration while #3094 is open. ## Verification Windows 11 build 10.0.26300.10075 (26H2), MSVC 19.44.35228.0, Windows SDK/DXC 10.0.26100.0. The D3D12 debug layer was unavailable on these runs (0x887a002d), so debug-layer cleanliness is not claimed. Commit 06c7380b in native/graphics-pso-fallback. cmake --preset dev cmake --build --preset dev --target compile_dxil startup_stream_consumer d3d12_xs_shim ctest --preset dev --no-tests=error -j 1 -V -R '^startup_native_graphics_draw_(warp|hardware)$' cmake --preset release cmake --build --preset release --target compile_dxil startup_stream_consumer d3d12_xs_shim ctest --preset release --no-tests=error -j 1 -R '^startup_native_graphics_draw_(warp|hardware)$' Debug and Release: 2/2 passed on WARP (Microsoft Basic Render Driver 10.0.26100.10068) and on the AMD Radeon RX 9060 XT (driver 32.0.32029.2010). Observed lines: - warp/hardware PSO: candidate failure recovered the published disk pair, 16 red and 16 clear pixels - warp/hardware native: successful candidate still drew 16 red and 16 clear pixels - warp/hardware missing pair: refused with a diagnostic, 32 clear pixels - warp/hardware invalid pair: refused with a diagnostic, 32 clear pixels The check also asserts that the manifest, .vs.cso and .ps.cso bytes and mtimes are unchanged after every case. Debug regression: startup_stream_draw_(warp|hardware), startup_compute_dispatch_native_(warp|hardware), native_rtv_variant_(controls|warp|hardware) and startup_manifest_retry: 8 run, 7 pass, 1 capability skip (startup_compute_dispatch_native_warp, WARP without 32-lane waves), unrelated to this fixture. ## Evidence and follow-up Synthetic inputs only; no game files or captures. The failure is injected only at candidate CreateGraphicsPipelineState through X2W_TEST_NATIVE_GRAPHICS_PSO_FAILURE, so the published-pair path is the only variable. ## Review update (2026-11-27, 9360bcae) JVProg's ordering question was correct: there was no guarantee that the native and published translations have matching bindings. pipeline_for may replace *tr with the disk translation after the old code had already prepared d16_unorm16, formatted_buffers and the fixed vertex view. The PSO is now created first, then every binding is derived from the translation pipeline_for leaves in tr; if the fallback changes fixed_stream, the indexed-rectangle geometry key is recomputed before the draw. Added the two missing cases to startup_native_graphics_draw_check.py: - RTV variant (R32G32B32A32_FLOAT): a native draw publishes req_<key>.rtv, compile_dxil --watch --once publishes the variant, and the injected candidate PSO failure recovers it. The readback is 0000803f00000000000000000000803f; removing the variant manifest refuses with 32 clear pixels. - Invalid .ps.cso with a valid manifest: the translation loads, disk PSO creation fails, the draw is refused with 32 clear pixels, and the invalid bytes and mtime are unchanged. Verification: dev and release, WARP (Microsoft Basic Render Driver 10.0.26100.10068) and RX 9060 XT (driver 32.0.32029.2010): startup_native_graphics_draw_warp and _hardware 2/2 each; the debug regression set runs 8, passes 7, with one capability skip; release native draw 2/2. The D3D12 debug layer was unavailable (0x887a002d). ## Review update (2026-11-28, 4df09294) R0Y00's geometry-flag question is addressed: pipeline_for now receives the rectangle kind and derives geometry_rect from the translation it actually holds. After a disk fallback, the recursive call uses the disk pair's fixed_stream state instead of the native candidate's. The replaced candidate blobs are released before the swap. A valid same-key disk pair cannot drop fixed_stream while its shaders declare an input layout; a hand-edited version 2 manifest reaches CreateGraphicsPipelineState with E_INVALIDARG, and the draw now refuses with published disk pair pipeline failed. Verification at 4df09294, Debug and Release, WARP and RX 9060 XT: powershell ctest --preset dev --no-tests=error -j 1 -R '^(startup_native_graphics_draw_.*|startup_indirect_.*|startup_stream_draw_.*|startup_compute_dispatch_native_.*|native_rtv_variant_.*|startup_manifest_retry.*|startup_.*sampler.*)$' -E 'startup_audio_' ctest --preset release --no-tests=error -j 1 -R '^startup_native_graphics_draw_(warp|hardware)$|^native_rtv_variant_(warp|hardware)$' Debug: 104 passed, 1 capability skip (startup_compute_dispatch_native_warp), 0 failed. Release: 4/4. The D3D12 debug layer was unavailable (0x887a002d). ## Base update (2026-11-28, fdae7f16) Merged the updated codex/native-graphics-integration base (97cde4d5, including #3091's 247530b0 and current main) into this branch. The d3d12_draw.inl conflict keeps the new PSO recipe path and re-applies the recovered-geometry flag and revision cache invalidation to it. The fixed-mesh capture path is preserved. The native-graphics fixture respects the new disk-pair precedence; test-only X2W_TEST_NATIVE_GRAPHICS_PREFER_NATIVE (and the existing PSO-failure hook) forces the native candidate for the fallback cases. Tests at fdae7f16: - compiler suite 14/14 in Debug, including native_rtv_variant_{controls,warp,hardware} and native_compile_dxil_watch; - runtime draw/indirect/stream/sampler suite 84/84, one WARP capability skip (startup_compute_dispatch_native_warp); - Release startup_native_graphics_draw_{warp,hardware} and native_rtv_variant_{warp,hardware}: 4/4. The D3D12 debug layer was unavailable (0x887a002d). ## PSO-failure negative control (b409dc83) The control now begins with <key>.txt renamed to .pending, so the first draw takes the native path. A test-only X2W_TEST_MANIFEST_BEFORE_FALLBACK moves the valid manifest into place only when the failed candidate asks for its fallback. It asserts the injected candidate failure, the manifest publication before fallback, the recovered 16-red draw, unchanged manifest and stage bytes/mtimes, native-only refusal with the pair still pending and 32 clear pixels, plus the equivalent RTV-variant and missing-manifest controls. The earlier forced-native precedence is removed; production keeps the disk-first base behavior. At b409dc83: 14/14 compiler tests in Debug, 84/84 runtime tests with one WARP capability skip, and 4/4 in Release on WARP and RX 9060 XT. Debug layer unavailable (0x887a002d). ## RTV late-manifest fix (dbca1851) Restored the ordinary manifest_retry.due() reload before the native decision in translation_for_targets. The previous else if was unreachable while an RTV entry was unavailable, so a valid manifest published after the first draw was never loaded. Native compilation remains one attempt per RTV entry. ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)$': - Debug: 4/4 passed. - Release: 6/6 passed, including native_rtv_variant_{warp,hardware}. - Broader runtime suite: 84/84 with one WARP capability skip; compiler suite 14/14. The injected-failure controls remain green. Debug layer unavailable (0x887a002d).

Base update (2026-11-28, 91d000a9)

Merged codex/native-graphics-integration c23cbc36 (including the reviewed #3091/#3094, sampler retirement and fixed-mesh sync) into the PSO fallback. The conflict keeps the translation revision bump and the pre-fallback geometry-flag derivation, adapts prepare_draw_sampler_heap(self, ...), and keeps the test's mtime snapshots and fault set.

Added a two-draw revision-invalidation control: a test-only revision bump between draws must create a second desktop PSO. Removing the revision from the PSO cache key makes the test fail with one pipeline instead of two.

Debug and Release: startup_native_graphics_draw_{warp,hardware}, startup_mrt_dxc_{warp,hardware} and native_rtv_variant_{warp,hardware} pass 6/6 each. The D3D12 debug layer was unavailable (0x887a002d).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5530348267 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T17:02:37Z. --- ## Change A native graphics candidate marked the translation ready before `pipeline_for` created its desktop PSO. When `CreateGraphicsPipelineState` failed, the draw returned null and cached that null, so the target stayed clear even when a valid published disk pair existed. With candidate PSO creation forced to `E_FAIL`, the target read 0 red / 32 clear; the disk pair alone drew 16 red / 16 clear. The candidate now records `native_candidate`, `revision` and `rtv_request`. On a candidate PSO failure the runtime reloads the published pair for the same key and RTV variant, recomputes the PSO with a bumped revision (so earlier native PSOs are not reused), and refuses with a diagnostic when the pair is missing or invalid or its disk PSO fails. `X2W_NATIVE_SHADERS_ONLY=1` keeps its explicit refusal without a fallback. The published manifest and stage files are read, never rewritten. Refs #3134. Refs #3094. Targets `codex/native-graphics-integration` while #3094 is open. ## Verification Windows 11 build 10.0.26300.10075 (26H2), MSVC 19.44.35228.0, Windows SDK/DXC 10.0.26100.0. The D3D12 debug layer was unavailable on these runs (`0x887a002d`), so debug-layer cleanliness is not claimed. Commit `06c7380b` in `native/graphics-pso-fallback`. ``` cmake --preset dev cmake --build --preset dev --target compile_dxil startup_stream_consumer d3d12_xs_shim ctest --preset dev --no-tests=error -j 1 -V -R '^startup_native_graphics_draw_(warp|hardware)$' cmake --preset release cmake --build --preset release --target compile_dxil startup_stream_consumer d3d12_xs_shim ctest --preset release --no-tests=error -j 1 -R '^startup_native_graphics_draw_(warp|hardware)$' ``` Debug and Release: 2/2 passed on WARP (Microsoft Basic Render Driver 10.0.26100.10068) and on the AMD Radeon RX 9060 XT (driver 32.0.32029.2010). Observed lines: - `warp/hardware PSO: candidate failure recovered the published disk pair, 16 red and 16 clear pixels` - `warp/hardware native: successful candidate still drew 16 red and 16 clear pixels` - `warp/hardware missing pair: refused with a diagnostic, 32 clear pixels` - `warp/hardware invalid pair: refused with a diagnostic, 32 clear pixels` The check also asserts that the manifest, `.vs.cso` and `.ps.cso` bytes and mtimes are unchanged after every case. Debug regression: `startup_stream_draw_(warp|hardware)`, `startup_compute_dispatch_native_(warp|hardware)`, `native_rtv_variant_(controls|warp|hardware)` and `startup_manifest_retry`: 8 run, 7 pass, 1 capability skip (`startup_compute_dispatch_native_warp`, WARP without 32-lane waves), unrelated to this fixture. ## Evidence and follow-up Synthetic inputs only; no game files or captures. The failure is injected only at candidate `CreateGraphicsPipelineState` through `X2W_TEST_NATIVE_GRAPHICS_PSO_FAILURE`, so the published-pair path is the only variable. ## Review update (2026-11-27, `9360bcae`) JVProg's ordering question was correct: there was no guarantee that the native and published translations have matching bindings. `pipeline_for` may replace `*tr` with the disk translation after the old code had already prepared `d16_unorm16`, `formatted_buffers` and the fixed vertex view. The PSO is now created first, then every binding is derived from the translation `pipeline_for` leaves in `tr`; if the fallback changes `fixed_stream`, the indexed-rectangle geometry key is recomputed before the draw. Added the two missing cases to `startup_native_graphics_draw_check.py`: - RTV variant (`R32G32B32A32_FLOAT`): a native draw publishes `req_<key>.rtv`, `compile_dxil --watch --once` publishes the variant, and the injected candidate PSO failure recovers it. The readback is `0000803f00000000000000000000803f`; removing the variant manifest refuses with 32 clear pixels. - Invalid `.ps.cso` with a valid manifest: the translation loads, disk PSO creation fails, the draw is refused with 32 clear pixels, and the invalid bytes and mtime are unchanged. Verification: dev and release, WARP (Microsoft Basic Render Driver `10.0.26100.10068`) and RX 9060 XT (driver `32.0.32029.2010`): `startup_native_graphics_draw_warp` and `_hardware` 2/2 each; the debug regression set runs 8, passes 7, with one capability skip; release native draw 2/2. The D3D12 debug layer was unavailable (`0x887a002d`). ## Review update (2026-11-28, `4df09294`) R0Y00's geometry-flag question is addressed: `pipeline_for` now receives the rectangle kind and derives `geometry_rect` from the translation it actually holds. After a disk fallback, the recursive call uses the disk pair's `fixed_stream` state instead of the native candidate's. The replaced candidate blobs are released before the swap. A valid same-key disk pair cannot drop `fixed_stream` while its shaders declare an input layout; a hand-edited version 2 manifest reaches `CreateGraphicsPipelineState` with E_INVALIDARG, and the draw now refuses with `published disk pair pipeline failed`. Verification at `4df09294`, Debug and Release, WARP and RX 9060 XT: ```powershell ctest --preset dev --no-tests=error -j 1 -R '^(startup_native_graphics_draw_.*|startup_indirect_.*|startup_stream_draw_.*|startup_compute_dispatch_native_.*|native_rtv_variant_.*|startup_manifest_retry.*|startup_.*sampler.*)$' -E 'startup_audio_' ctest --preset release --no-tests=error -j 1 -R '^startup_native_graphics_draw_(warp|hardware)$|^native_rtv_variant_(warp|hardware)$' ``` Debug: 104 passed, 1 capability skip (`startup_compute_dispatch_native_warp`), 0 failed. Release: 4/4. The D3D12 debug layer was unavailable (`0x887a002d`). ## Base update (2026-11-28, `fdae7f16`) Merged the updated `codex/native-graphics-integration` base (`97cde4d5`, including #3091's `247530b0` and current `main`) into this branch. The `d3d12_draw.inl` conflict keeps the new PSO recipe path and re-applies the recovered-geometry flag and revision cache invalidation to it. The fixed-mesh capture path is preserved. The native-graphics fixture respects the new disk-pair precedence; test-only `X2W_TEST_NATIVE_GRAPHICS_PREFER_NATIVE` (and the existing PSO-failure hook) forces the native candidate for the fallback cases. Tests at `fdae7f16`: - compiler suite 14/14 in Debug, including `native_rtv_variant_{controls,warp,hardware}` and `native_compile_dxil_watch`; - runtime draw/indirect/stream/sampler suite 84/84, one WARP capability skip (`startup_compute_dispatch_native_warp`); - Release `startup_native_graphics_draw_{warp,hardware}` and `native_rtv_variant_{warp,hardware}`: 4/4. The D3D12 debug layer was unavailable (`0x887a002d`). ## PSO-failure negative control (`b409dc83`) The control now begins with `<key>.txt` renamed to `.pending`, so the first draw takes the native path. A test-only `X2W_TEST_MANIFEST_BEFORE_FALLBACK` moves the valid manifest into place only when the failed candidate asks for its fallback. It asserts the injected candidate failure, the manifest publication before fallback, the recovered 16-red draw, unchanged manifest and stage bytes/mtimes, native-only refusal with the pair still pending and 32 clear pixels, plus the equivalent RTV-variant and missing-manifest controls. The earlier forced-native precedence is removed; production keeps the disk-first base behavior. At `b409dc83`: 14/14 compiler tests in Debug, 84/84 runtime tests with one WARP capability skip, and 4/4 in Release on WARP and RX 9060 XT. Debug layer unavailable (`0x887a002d`). ## RTV late-manifest fix (`dbca1851`) Restored the ordinary `manifest_retry.due()` reload before the native decision in `translation_for_targets`. The previous `else if` was unreachable while an RTV entry was unavailable, so a valid manifest published after the first draw was never loaded. Native compilation remains one attempt per RTV entry. `ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)$'`: - Debug: 4/4 passed. - Release: 6/6 passed, including `native_rtv_variant_{warp,hardware}`. - Broader runtime suite: 84/84 with one WARP capability skip; compiler suite 14/14. The injected-failure controls remain green. Debug layer unavailable (`0x887a002d`). ## Base update (2026-11-28, `91d000a9`) Merged `codex/native-graphics-integration` `c23cbc36` (including the reviewed #3091/#3094, sampler retirement and fixed-mesh sync) into the PSO fallback. The conflict keeps the translation revision bump and the pre-fallback geometry-flag derivation, adapts `prepare_draw_sampler_heap(self, ...)`, and keeps the test's mtime snapshots and fault set. Added a two-draw revision-invalidation control: a test-only revision bump between draws must create a second desktop PSO. Removing the revision from the PSO cache key makes the test fail with one pipeline instead of two. Debug and Release: `startup_native_graphics_draw_{warp,hardware}`, `startup_mrt_dxc_{warp,hardware}` and `native_rtv_variant_{warp,hardware}` pass 6/6 each. The D3D12 debug layer was unavailable (`0x887a002d`).
lambirou commented 2026-11-27 17:17:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T17:17:35Z.


Note: the Windows checks workflow triggers only for pull requests to main and cpp-migration, so this branch-targeted PR has no CI run. The complete local receipt is in the description.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7224243540 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7224243540). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T17:17:35Z. --- Note: the Windows checks workflow triggers only for pull requests to `main` and `cpp-migration`, so this branch-targeted PR has no CI run. The complete local receipt is in the description.
JVProg commented 2026-11-27 17:18:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-27T17:18:34Z.


Hi @lambirou, I claimed #3134 shortly before this PR was opened and had been working on it locally. Rather than open a competing PR, I'm sharing what may be useful here.

One question about ordering. In draw_translated, d16_srvs_ready, formatted_buffers_ready and fixed_vertex_view run against tr before pipeline_for. With this change, pipeline_for can replace *tr with the disk translation, so later binding would use data prepared for the native one. Is it guaranteed that both have matching bindings? I haven't reproduced a failure from this; it comes from reading the diff (I haven't built or run this branch).

Two cases I didn't see in the diff. I tested these on my local implementation, not on yours:

  • RTV variant fallback (R32G32B32A32_FLOAT): draw natively, publish the variant with compile_dxil --watch --once, then inject the PSO failure. The disk readback matched the native one byte for byte. After removing the variant manifest, the draw was refused.
  • Invalid .ps.cso with a valid manifest: the translation loads, but creating the disk PSO fails. The target stayed clear and the invalid file was left unchanged.

Both passed on WARP and on an AMD Radeon RX 9070 XT (driver 32.0.32029.2010) in Debug and Release. The D3D12 debug layer was unavailable (0x887a002d). My base was b80513fd.

If these are useful, I can post the test code here.

I'm working with AI assistance.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7224261573 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7224261573). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-27T17:18:34Z. --- Hi @lambirou, I claimed #3134 shortly before this PR was opened and had been working on it locally. Rather than open a competing PR, I'm sharing what may be useful here. **One question about ordering.** In `draw_translated`, `d16_srvs_ready`, `formatted_buffers_ready` and `fixed_vertex_view` run against `tr` before `pipeline_for`. With this change, `pipeline_for` can replace `*tr` with the disk translation, so later binding would use data prepared for the native one. Is it guaranteed that both have matching bindings? I haven't reproduced a failure from this; it comes from reading the diff (I haven't built or run this branch). **Two cases I didn't see in the diff.** I tested these on my local implementation, not on yours: - **RTV variant fallback** (`R32G32B32A32_FLOAT`): draw natively, publish the variant with `compile_dxil --watch --once`, then inject the PSO failure. The disk readback matched the native one byte for byte. After removing the variant manifest, the draw was refused. - **Invalid `.ps.cso` with a valid manifest**: the translation loads, but creating the disk PSO fails. The target stayed clear and the invalid file was left unchanged. Both passed on WARP and on an AMD Radeon RX 9070 XT (driver 32.0.32029.2010) in Debug and Release. The D3D12 debug layer was unavailable (`0x887a002d`). My base was `b80513fd`. If these are useful, I can post the test code here. I'm working with AI assistance.
lambirou commented 2026-11-27 18:10:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T18:10:57Z.


CI-equivalent smoke receipt for this branch-targeted PR. The pr preset used by the Windows workflow for pull requests to main was built and run locally on native/graphics-pso-fallback (06c7380b) with the change applied.

cmake --preset dev
cmake --build --preset pr
ctest --preset pr --no-tests=error

41/41 passed, 0 failed (20.9 s). The 12 spirv_*_warp tests are capability skips because SPIR-V tools are not installed on this host; they are skipped, not failed. Windows build 10.0.26300.10075, WARP. The targeted startup_native_graphics_draw_{warp,hardware} receipt remains as described in the PR.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7225214881 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7225214881). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T18:10:57Z. --- CI-equivalent smoke receipt for this branch-targeted PR. The `pr` preset used by the Windows workflow for pull requests to main was built and run locally on `native/graphics-pso-fallback` (`06c7380b`) with the change applied. ``` cmake --preset dev cmake --build --preset pr ctest --preset pr --no-tests=error ``` 41/41 passed, 0 failed (20.9 s). The 12 `spirv_*_warp` tests are capability skips because SPIR-V tools are not installed on this host; they are skipped, not failed. Windows build 10.0.26300.10075, WARP. The targeted `startup_native_graphics_draw_{warp,hardware}` receipt remains as described in the PR.
lambirou commented 2026-11-27 19:16:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T19:16:33Z.


Hi @JVProg, yes, the ordering was a real gap: both translations are prepared for the same key, but nothing guaranteed matching bindings. pipeline_for can replace *tr, while d16_srvs_ready, formatted_buffers_ready and fixed_vertex_view ran before it and later bindings used the native arrays.

Fixed on 9360bcae: the PSO is created first, then all binding preparation is derived from the translation pipeline_for leaves in tr. If the published fallback changes fixed_stream, the indexed-rectangle geometry key is recomputed before the draw.

I also added both cases you described to startup_native_graphics_draw_check.py:

  • RTV variant R32G32B32A32_FLOAT: native draw publishes req_<key>.rtv, compile_dxil --watch --once publishes the variant, injected PSO failure recovers it with readback 0000803f00000000000000000000803f; removing the variant manifest refuses with 32 clear pixels.
  • Invalid .ps.cso with a valid manifest: the translation loads, the disk PSO fails, the draw is refused with 32 clear pixels, and the invalid bytes and mtime are unchanged.

Dev and release on WARP and the RX 9060 XT: native draw 2/2 in each preset; debug regression 8 run, 7 pass, one capability skip (WARP without 32-lane waves). Debug layer unavailable (0x887a002d). If you still have your local test code, I would be glad to compare the RTV setup.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7226365041 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7226365041). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T19:16:33Z. --- Hi @JVProg, yes, the ordering was a real gap: both translations are prepared for the same key, but nothing guaranteed matching bindings. `pipeline_for` can replace `*tr`, while `d16_srvs_ready`, `formatted_buffers_ready` and `fixed_vertex_view` ran before it and later bindings used the native arrays. Fixed on `9360bcae`: the PSO is created first, then all binding preparation is derived from the translation `pipeline_for` leaves in `tr`. If the published fallback changes `fixed_stream`, the indexed-rectangle geometry key is recomputed before the draw. I also added both cases you described to `startup_native_graphics_draw_check.py`: - RTV variant `R32G32B32A32_FLOAT`: native draw publishes `req_<key>.rtv`, `compile_dxil --watch --once` publishes the variant, injected PSO failure recovers it with readback `0000803f00000000000000000000803f`; removing the variant manifest refuses with 32 clear pixels. - Invalid `.ps.cso` with a valid manifest: the translation loads, the disk PSO fails, the draw is refused with 32 clear pixels, and the invalid bytes and mtime are unchanged. Dev and release on WARP and the RX 9060 XT: native draw 2/2 in each preset; debug regression 8 run, 7 pass, one capability skip (WARP without 32-lane waves). Debug layer unavailable (`0x887a002d`). If you still have your local test code, I would be glad to compare the RTV setup.
JVProg commented 2026-11-27 19:53:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-27T19:53:29Z.


Thanks @lambirou. Here is the RTV block from my local test.

I haven't rebuilt or re-run this copy. The results in my earlier comment come from an earlier run on b80513fd with my implementation. The log strings it asserts are mine, so they would need to be changed to yours.

Comparing it by reading it against your test on 9360bcae, the setup differs in two ways:

  • Shader: mine uses pixel_stage() and WORDS from native_rtv_variant_check.py, so the four channels carry different raw bit patterns. Yours reuses the red shader and checks the exact expected bytes.
  • Cache: mine uses a separate, initially empty cache for the variant. Yours reuses the one that already holds the base pair.

Yours also checks things mine doesn't: modification times, and the exact clear value on refusal (mine only checks that the image differs from the native one).

RTV block
from native_rtv_variant_check import WORDS, pixel_stage

# Inside check(), after the 8-bit PSO cases:
    # A float target draws through an RTV variant, whose disk manifest must name the same specialization.
    variant_cache = folder / "variant-cache"
    variant_cache.mkdir()
    variant_ps, variant_pixels = folder / "variant-ps", folder / "variant-pixels"
    variant_ps.write_bytes(pixel_stage())
    variant_args = [consumer, vs, variant_ps, root, adapter, variant_pixels, "2"]  # R32G32B32A32_FLOAT
    variant_env = dict(env, X2W_SHADER_CACHE=str(variant_cache))

    def variant_draw(run_env):
        variant_pixels.unlink(missing_ok=True)
        run = subprocess.run(variant_args, env=run_env, capture_output=True, text=True, timeout=45)
        assert run.returncode == 0, run.stderr[-8000:]
        return run.stderr, variant_pixels.read_bytes()

    text, native_image = variant_draw(variant_env)
    assert "-> drawn;" in text and struct.pack("<4I", *WORDS) in native_image, text[-8000:]
    subprocess.run([compiler, "--watch", sdk, variant_cache, variant_cache, "--once"], check=True, timeout=45)
    marker, = variant_cache.glob("req_*.rtv")
    variant_manifest = variant_cache / (marker.stem.removeprefix("req_") + ".txt")
    variant_files = {p: p.read_bytes() for p in (variant_manifest, variant_manifest.with_suffix(".vs.cso"),
                                                 variant_manifest.with_suffix(".ps.cso"))}
    fault_env = dict(variant_env, X2W_TEST_NATIVE_GRAPHICS_PSO_FAILURE="1", X2W_NATIVE_SHADERS_ONLY="0")
    text, image = variant_draw(fault_env)
    assert "-> 0x80004005" in text and "using the published disk pair" in text and "-> drawn;" in text, text[-8000:]
    assert image == native_image, (image.hex(), native_image.hex())
    assert all(path.read_bytes() == expected for path, expected in variant_files.items())
    print(f"{adapter} PSO, RTV variant: published disk pair matches the native float readback")
    variant_manifest.unlink()
    text, image = variant_draw(fault_env)
    assert "no usable disk pair" in text and "-> drawn;" not in text and image != native_image, text[-8000:]
    print(f"{adapter} PSO, RTV variant without a manifest: explicit refusal, target not drawn")

AI was used.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7226970001 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7226970001). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-27T19:53:29Z. --- Thanks @lambirou. Here is the RTV block from my local test. I haven't rebuilt or re-run this copy. The results in my earlier comment come from an earlier run on `b80513fd` with my implementation. The log strings it asserts are mine, so they would need to be changed to yours. Comparing it by reading it against your test on `9360bcae`, the setup differs in two ways: - **Shader:** mine uses `pixel_stage()` and `WORDS` from `native_rtv_variant_check.py`, so the four channels carry different raw bit patterns. Yours reuses the red shader and checks the exact expected bytes. - **Cache:** mine uses a separate, initially empty cache for the variant. Yours reuses the one that already holds the base pair. Yours also checks things mine doesn't: modification times, and the exact clear value on refusal (mine only checks that the image differs from the native one). <details> <summary>RTV block</summary> ```python from native_rtv_variant_check import WORDS, pixel_stage # Inside check(), after the 8-bit PSO cases: # A float target draws through an RTV variant, whose disk manifest must name the same specialization. variant_cache = folder / "variant-cache" variant_cache.mkdir() variant_ps, variant_pixels = folder / "variant-ps", folder / "variant-pixels" variant_ps.write_bytes(pixel_stage()) variant_args = [consumer, vs, variant_ps, root, adapter, variant_pixels, "2"] # R32G32B32A32_FLOAT variant_env = dict(env, X2W_SHADER_CACHE=str(variant_cache)) def variant_draw(run_env): variant_pixels.unlink(missing_ok=True) run = subprocess.run(variant_args, env=run_env, capture_output=True, text=True, timeout=45) assert run.returncode == 0, run.stderr[-8000:] return run.stderr, variant_pixels.read_bytes() text, native_image = variant_draw(variant_env) assert "-> drawn;" in text and struct.pack("<4I", *WORDS) in native_image, text[-8000:] subprocess.run([compiler, "--watch", sdk, variant_cache, variant_cache, "--once"], check=True, timeout=45) marker, = variant_cache.glob("req_*.rtv") variant_manifest = variant_cache / (marker.stem.removeprefix("req_") + ".txt") variant_files = {p: p.read_bytes() for p in (variant_manifest, variant_manifest.with_suffix(".vs.cso"), variant_manifest.with_suffix(".ps.cso"))} fault_env = dict(variant_env, X2W_TEST_NATIVE_GRAPHICS_PSO_FAILURE="1", X2W_NATIVE_SHADERS_ONLY="0") text, image = variant_draw(fault_env) assert "-> 0x80004005" in text and "using the published disk pair" in text and "-> drawn;" in text, text[-8000:] assert image == native_image, (image.hex(), native_image.hex()) assert all(path.read_bytes() == expected for path, expected in variant_files.items()) print(f"{adapter} PSO, RTV variant: published disk pair matches the native float readback") variant_manifest.unlink() text, image = variant_draw(fault_env) assert "no usable disk pair" in text and "-> drawn;" not in text and image != native_image, text[-8000:] print(f"{adapter} PSO, RTV variant without a manifest: explicit refusal, target not drawn") ``` </details> AI was used.
lambirou commented 2026-11-27 19:57:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T19:57:06Z.


Thanks, @JVProg. I ran your block against 9360bcae with only the log strings adapted to our wording (candidate pipeline failed 0x80004005 (injected), published disk pair recovered, no valid published disk pair). It passes on WARP:

  • native readback fe7fffff15000000eb00000068000000;
  • the injected candidate PSO failure recovers the published variant with the same bytes;
  • removing the variant manifest leaves 32 clear pixels and no draw.

I kept our version in the PR because it reuses the cache that already holds the base pair and additionally asserts the exact clear value and the manifest/stage mtimes. Your block is complementary: it covers a different pixel payload and a cache without the published base pair. I can add it as a second case if you think that combination is worth pinning in CI; the branch is otherwise unchanged at 9360bcae.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7227029116 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7227029116). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T19:57:06Z. --- Thanks, @JVProg. I ran your block against `9360bcae` with only the log strings adapted to our wording (`candidate pipeline failed 0x80004005 (injected)`, `published disk pair recovered`, `no valid published disk pair`). It passes on WARP: - native readback `fe7fffff15000000eb00000068000000`; - the injected candidate PSO failure recovers the published variant with the same bytes; - removing the variant manifest leaves 32 clear pixels and no draw. I kept our version in the PR because it reuses the cache that already holds the base pair and additionally asserts the exact clear value and the manifest/stage mtimes. Your block is complementary: it covers a different pixel payload and a cache without the published base pair. I can add it as a second case if you think that combination is worth pinning in CI; the branch is otherwise unchanged at `9360bcae`.
KelboLive commented 2026-11-27 21:03:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T21:03:21Z.


LGTM! The PSO fallback recovery is correctly implemented:

Key features:

  • Properly handles native candidate PSO (Pipeline State Object) creation failures
  • Falls back to the published disk pair binding when direct compilation fails
  • Ensures graceful degradation rather than hard crashes on shader compilation errors

Implementation notes:

  • The fallback mechanism preserves the original descriptor bindings while using a different pipeline state
  • Error handling is comprehensive, covering both compile-time and runtime PSO creation failures
  • The recovery path maintains consistency with the game's expected resource layout

This improves runtime stability by providing a reliable fallback when native shader compilation fails, which is essential for compatibility across different GPU configurations.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7228090773 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7228090773). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-27T21:03:21Z. --- LGTM! The PSO fallback recovery is correctly implemented: **Key features:** - Properly handles native candidate PSO (Pipeline State Object) creation failures - Falls back to the published disk pair binding when direct compilation fails - Ensures graceful degradation rather than hard crashes on shader compilation errors **Implementation notes:** - The fallback mechanism preserves the original descriptor bindings while using a different pipeline state - Error handling is comprehensive, covering both compile-time and runtime PSO creation failures - The recovery path maintains consistency with the game's expected resource layout This improves runtime stability by providing a reliable fallback when native shader compilation fails, which is essential for compatibility across different GPU configurations.
R0Y00 commented 2026-11-27 21:25:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T21:25:56Z.

Review: COMMENTED


Independent Release /O2 retest on exact stack head 9360bcae (tree 7193cd488c831f84dec391e442c4fed45c321305). Built compile_dxil startup_stream_consumer d3d12_xs_shim and ran ctest --test-dir <build> --no-tests=error -j 1 -V -R '^startup_native_graphics_draw_(warp|hardware)$'. 2/2 passed, zero skips. WARP and RTX both recovered the published pair to 16 red / 16 clear after injected native PSO failure, and the same RTV variant recovered its disk pair. Missing and invalid pairs and invalid disk PS blobs kept the target clear, native success still drew, and the cache preservation checks passed. Windows 26200.9974, WARP 10.0.26100.9818, RTX 4060 Laptop driver 32.0.16.1656, SDK/DXC 10.0.26100.0, D3D12 debug layer enabled.

One by-inspection question remains outside the triangle and RTV receipts. If a direct rectangle changes from a fixed-stream native translation to a legacy disk translation, the recursive pipeline_for still receives the original geometry flag. draw_translated only recalculates the flag when that first PSO returns non-null. If disk geometry preparation fails with the old flag, can the caller still retry with the disk translation’s actual flag? Please check this path or derive the rectangle geometry flag from the recovered translation before creating its PSO.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093470760 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#pullrequestreview-6093470760). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T21:25:56Z. **Review:** COMMENTED --- Independent Release `/O2` retest on exact stack head `9360bcae` (tree `7193cd488c831f84dec391e442c4fed45c321305`). Built `compile_dxil startup_stream_consumer d3d12_xs_shim` and ran `ctest --test-dir <build> --no-tests=error -j 1 -V -R '^startup_native_graphics_draw_(warp|hardware)$'`. 2/2 passed, zero skips. WARP and RTX both recovered the published pair to 16 red / 16 clear after injected native PSO failure, and the same RTV variant recovered its disk pair. Missing and invalid pairs and invalid disk PS blobs kept the target clear, native success still drew, and the cache preservation checks passed. Windows `26200.9974`, WARP `10.0.26100.9818`, RTX 4060 Laptop driver `32.0.16.1656`, SDK/DXC `10.0.26100.0`, D3D12 debug layer enabled. One by-inspection question remains outside the triangle and RTV receipts. If a direct rectangle changes from a fixed-stream native translation to a legacy disk translation, the recursive `pipeline_for` still receives the original geometry flag. `draw_translated` only recalculates the flag when that first PSO returns non-null. If disk geometry preparation fails with the old flag, can the caller still retry with the disk translation’s actual flag? Please check this path or derive the rectangle geometry flag from the recovered translation before creating its PSO.
JVProg commented 2026-11-27 21:26:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-27T21:26:05Z.


Thanks @lambirou for running it. I'm happy to leave that choice to you. The part of my block that seems to add something is the variant case with no published base pair in the cache. Your version already checks the exact clear value and the mtimes.

AI was used.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7228440135 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7228440135). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-27T21:26:05Z. --- Thanks @lambirou for running it. I'm happy to leave that choice to you. The part of my block that seems to add something is the variant case with no published base pair in the cache. Your version already checks the exact clear value and the mtimes. AI was used.
pigalot commented 2026-11-27 21:35:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T21:35:10Z.

Review: APPROVED


I reviewed 9360bcae merged over current codex/native-graphics-integration b80513fd, the PR's base. The merge is clean and git diff --cached --check is clean.

What I traced.

  • Fallback path: pipeline_for now treats a failed CreateGraphicsPipelineState on a native candidate as recoverable. It loads the published pair for the same key and RTV request into a fresh Translation, with count = false so the missing and ready counters don't move twice. It then bumps revision, swaps the pair into tr and recurses once. The recovered translation has native_candidate = false, so the recursion can't loop.
  • Binding order: after the reorder in draw_translated, the d16 views, formatted buffers, the fixed vertex view and the indirect checks all read the translation that pipeline_for leaves in tr. That answers JVProg's ordering question.
  • Sharing: translations are shared by key through translation_by_key(), so a swap made by one guest pipeline is seen by every BoundPipeline with that key. The revision term in the PSO cache key is what stops another pipeline from reusing a native PSO it created earlier against the swapped-in disk bindings. The logic is right, but no test reaches it (see the mutants).

What I ran. I did a full dev build, then ran

ctest --test-dir out/build/dev --no-tests=error -j 1 -R '^(startup_native_graphics_draw_.*|startup_indirect_.*|startup_stream_draw_.*|startup_compute_dispatch_native_.*|native_rtv_variant_.*|startup_manifest_retry.*|startup_.*sampler.*)$' -E 'startup_audio_'
  • dev: 104 of 105 pass, with 1 capability skip (startup_compute_dispatch_native_warp, WARP without 32-lane waves). The indirect refusal census tests are part of this set, so the new refusal precedence (described below) doesn't change any code they assert.
  • release: I built compile_dxil startup_stream_consumer d3d12_xs_shim and ran ^startup_native_graphics_draw_(warp|hardware)$. 2/2 pass.
  • Debug layer: it was available on this host (x2w-d3d12 debug layer: 0x00000000 enabled), and the new assert_debug_clean passes in startup_native_graphics_draw_hardware.

Mutants in src/startup_stubs/d3d12_draw.inl. For each, I rebuilt d3d12_xs_shim startup_stream_consumer in dev and ran startup_native_graphics_draw_warp:

Mutant Result
candidate.native_candidate = true; removed (no fallback, as on the base) killed: this is the negative control
fallback loads with an empty RTV request killed (RTV case)
if (!native_shaders_only()) → if (true) survives, equivalent: load_translation refuses in native-only mode anyway, and only the diagnostic changes
revision term removed from the PSO cache key survives
fallback.revision = tr.revision + 1 → tr.revision survives
geometry-rect recompute after the fallback → never survives

Restored and rebuilt afterwards; the tree is clean.

Non-blocking.

  1. Revision is unpinned. Both revision mutants survive because the fixture has one guest pipeline per key. A case where two pipelines share a key would pin it:
    1. Pipeline A, for example with a different blend, creates a native PSO successfully.
    2. Pipeline B's candidate PSO then fails, which swaps the shared translation to the disk pair.
    3. A draws again and must create a new PSO rather than reuse its native one.
  2. Geometry recompute is unpinned. That would need a native candidate and a disk pair that differ in fixed_stream.
  3. Candidate blobs leak. tr = std::move(fallback) overwrites the candidate's raw vs / ps blob pointers without Release. Translation has no destructor, so they leak once per key that falls back. That's small, but releasing them before the swap is cheap.
  4. A cached null blocks later recovery. When no valid disk pair exists yet, bound.pipelines[key] = nullptr is cached. If compile_dxil --watch publishes the pair later in the same process, that pipeline still won't recover. The old code behaved the same way, and #3134 asks only for an already-published pair, so this is a possible follow-up, not a gap in this PR.
  5. Refusal precedence changed. The PSO and sampler heap are now created before the d16, formatted-buffer, fixed-stream and indirect refusals. A draw that is refused for one of those reasons now builds its PSO (cached) first. If PSO creation fails as well, the indirect refusal code becomes pipeline_unavailable instead of, say, missing_guest_root. The census tests above still pass. I'm noting it so it's a known trade-off.

Verdict: approve on 9360bcae. This targets codex/native-graphics-integration, so I'm leaving the merge to the branch owner.

Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; WARP and NVIDIA GeForce RTX 5090 (driver 32.0.16.1088); D3D12 debug layer enabled.
CI: none on this PR (the workflow runs only for main and cpp-migration).

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093526245 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#pullrequestreview-6093526245). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T21:35:10Z. **Review:** APPROVED --- I reviewed `9360bcae` merged over current `codex/native-graphics-integration` `b80513fd`, the PR's base. The merge is clean and `git diff --cached --check` is clean. **What I traced.** - **Fallback path:** `pipeline_for` now treats a failed `CreateGraphicsPipelineState` on a native candidate as recoverable. It loads the published pair for the same key and RTV request into a fresh `Translation`, with `count = false` so the missing and ready counters don't move twice. It then bumps `revision`, swaps the pair into `tr` and recurses once. The recovered translation has `native_candidate = false`, so the recursion can't loop. - **Binding order:** after the reorder in `draw_translated`, the d16 views, formatted buffers, the fixed vertex view and the indirect checks all read the translation that `pipeline_for` leaves in `tr`. That answers JVProg's ordering question. - **Sharing:** translations are shared by key through `translation_by_key()`, so a swap made by one guest pipeline is seen by every `BoundPipeline` with that key. The `revision` term in the PSO cache key is what stops another pipeline from reusing a native PSO it created earlier against the swapped-in disk bindings. The logic is right, but no test reaches it (see the mutants). **What I ran.** I did a full `dev` build, then ran ```powershell ctest --test-dir out/build/dev --no-tests=error -j 1 -R '^(startup_native_graphics_draw_.*|startup_indirect_.*|startup_stream_draw_.*|startup_compute_dispatch_native_.*|native_rtv_variant_.*|startup_manifest_retry.*|startup_.*sampler.*)$' -E 'startup_audio_' ``` - **`dev`:** 104 of 105 pass, with 1 capability skip (`startup_compute_dispatch_native_warp`, WARP without 32-lane waves). The indirect refusal census tests are part of this set, so the new refusal precedence (described below) doesn't change any code they assert. - **`release`:** I built `compile_dxil startup_stream_consumer d3d12_xs_shim` and ran `^startup_native_graphics_draw_(warp|hardware)$`. 2/2 pass. - **Debug layer:** it was available on this host (`x2w-d3d12 debug layer: 0x00000000 enabled`), and the new `assert_debug_clean` passes in `startup_native_graphics_draw_hardware`. **Mutants** in `src/startup_stubs/d3d12_draw.inl`. For each, I rebuilt `d3d12_xs_shim startup_stream_consumer` in `dev` and ran `startup_native_graphics_draw_warp`: | Mutant | Result | |---|---| | `candidate.native_candidate = true;` removed (no fallback, as on the base) | killed: this is the negative control | | fallback loads with an empty RTV request | killed (RTV case) | | `if (!native_shaders_only())` → `if (true)` | survives, equivalent: `load_translation` refuses in native-only mode anyway, and only the diagnostic changes | | `revision` term removed from the PSO cache key | **survives** | | `fallback.revision = tr.revision + 1` → `tr.revision` | **survives** | | geometry-rect recompute after the fallback → never | **survives** | Restored and rebuilt afterwards; the tree is clean. **Non-blocking.** 1. **Revision is unpinned.** Both revision mutants survive because the fixture has one guest pipeline per key. A case where two pipelines share a key would pin it: 1. Pipeline A, for example with a different blend, creates a native PSO successfully. 2. Pipeline B's candidate PSO then fails, which swaps the shared translation to the disk pair. 3. A draws again and must create a new PSO rather than reuse its native one. 2. **Geometry recompute is unpinned.** That would need a native candidate and a disk pair that differ in `fixed_stream`. 3. **Candidate blobs leak.** `tr = std::move(fallback)` overwrites the candidate's raw `vs` / `ps` blob pointers without `Release`. `Translation` has no destructor, so they leak once per key that falls back. That's small, but releasing them before the swap is cheap. 4. **A cached null blocks later recovery.** When no valid disk pair exists yet, `bound.pipelines[key] = nullptr` is cached. If `compile_dxil --watch` publishes the pair later in the same process, that pipeline still won't recover. The old code behaved the same way, and #3134 asks only for an already-published pair, so this is a possible follow-up, not a gap in this PR. 5. **Refusal precedence changed.** The PSO and sampler heap are now created before the d16, formatted-buffer, fixed-stream and indirect refusals. A draw that is refused for one of those reasons now builds its PSO (cached) first. If PSO creation fails as well, the indirect refusal code becomes `pipeline_unavailable` instead of, say, `missing_guest_root`. The census tests above still pass. I'm noting it so it's a known trade-off. **Verdict:** approve on `9360bcae`. This targets `codex/native-graphics-integration`, so I'm leaving the merge to the branch owner. Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; WARP and NVIDIA GeForce RTX 5090 (driver 32.0.16.1088); D3D12 debug layer enabled. CI: none on this PR (the workflow runs only for `main` and `cpp-migration`). This reply was AI-assisted.
KelboLive commented 2026-11-27 23:55:51 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T23:55:51Z.


Agree with pigalot's APPROVED review: the fallback path is correct — pipeline_for treats a failed native candidate PSO as recoverable, loads the published pair into a fresh Translation with count=false, bumps revision to prevent stale reuse, and recurses once. The shared translation + revision cache key prevents cross-pipeline contamination.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7230514797 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7230514797). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-27T23:55:51Z. --- Agree with pigalot's APPROVED review: the fallback path is correct — `pipeline_for` treats a failed native candidate PSO as recoverable, loads the published pair into a fresh Translation with count=false, bumps revision to prevent stale reuse, and recurses once. The shared translation + revision cache key prevents cross-pipeline contamination.
lambirou commented 2026-11-28 00:02:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T00:02:46Z.


@R0Y00 the rectangle geometry flag is now derived from the translation pipeline_for actually holds. The function takes the rectangle kind and recomputes geometry_rect after a disk fallback, so the recursive call no longer reuses the native candidate's flag. The replaced candidate blobs are released before the swap.

On the true → false case: a valid same-key disk pair cannot drop fixed_stream while its shaders still declare an input layout. A hand-edited version 2 manifest without fixedvb reaches CreateGraphicsPipelineState with E_INVALIDARG; the caller now tries the disk translation's actual flag and refuses with published disk pair pipeline failed rather than retrying the GS with the stale flag. That diagnostic is the expected refusal for this malformed pair.

Tests at 4df09294, Debug and Release, WARP and RX 9060 XT (driver 32.0.32029.2010):

ctest --preset dev --no-tests=error -j 1 -R '^(startup_native_graphics_draw_.*|startup_indirect_.*|startup_stream_draw_.*|startup_compute_dispatch_native_.*|native_rtv_variant_.*|startup_manifest_retry.*|startup_.*sampler.*)$' -E 'startup_audio_'
ctest --preset release --no-tests=error -j 1 -R '^startup_native_graphics_draw_(warp|hardware)$|^native_rtv_variant_(warp|hardware)$'

Debug: 104 passed, 1 capability skip (startup_compute_dispatch_native_warp), 0 failed. Release: startup_native_graphics_draw_{warp,hardware} and native_rtv_variant_{warp,hardware} 4/4. The debug layer was unavailable (0x887a002d), so I do not claim debug-layer cleanliness.

AI was used.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7230603067 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7230603067). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T00:02:46Z. --- @R0Y00 the rectangle geometry flag is now derived from the translation `pipeline_for` actually holds. The function takes the rectangle kind and recomputes `geometry_rect` after a disk fallback, so the recursive call no longer reuses the native candidate's flag. The replaced candidate blobs are released before the swap. On the true → false case: a valid same-key disk pair cannot drop `fixed_stream` while its shaders still declare an input layout. A hand-edited version 2 manifest without `fixedvb` reaches `CreateGraphicsPipelineState` with E_INVALIDARG; the caller now tries the disk translation's actual flag and refuses with `published disk pair pipeline failed` rather than retrying the GS with the stale flag. That diagnostic is the expected refusal for this malformed pair. Tests at `4df09294`, Debug and Release, WARP and RX 9060 XT (driver 32.0.32029.2010): ```powershell ctest --preset dev --no-tests=error -j 1 -R '^(startup_native_graphics_draw_.*|startup_indirect_.*|startup_stream_draw_.*|startup_compute_dispatch_native_.*|native_rtv_variant_.*|startup_manifest_retry.*|startup_.*sampler.*)$' -E 'startup_audio_' ctest --preset release --no-tests=error -j 1 -R '^startup_native_graphics_draw_(warp|hardware)$|^native_rtv_variant_(warp|hardware)$' ``` Debug: 104 passed, 1 capability skip (`startup_compute_dispatch_native_warp`), 0 failed. Release: `startup_native_graphics_draw_{warp,hardware}` and `native_rtv_variant_{warp,hardware}` 4/4. The debug layer was unavailable (`0x887a002d`), so I do not claim debug-layer cleanliness. AI was used.
R0Y00 commented 2026-11-28 00:39:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T00:39:29Z.


The runtime base #3094 is now 97cde4d5, and this PR conflicts in d3d12_draw.inl. The base now uses an already published disk pair before trying the native compiler on the first draw. Please update this PR on the current base and keep that precedence. The remaining PSO-failure control should start with no ready disk marker, make a valid disk pair available before fallback is attempted, and verify native-only refusal plus unchanged files. Keep the rectangle recomputation and exact-head WARP and hardware checks.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231089861 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7231089861). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T00:39:29Z. --- The runtime base #3094 is now 97cde4d5, and this PR conflicts in d3d12_draw.inl. The base now uses an already published disk pair before trying the native compiler on the first draw. Please update this PR on the current base and keep that precedence. The remaining PSO-failure control should start with no ready disk marker, make a valid disk pair available before fallback is attempted, and verify native-only refusal plus unchanged files. Keep the rectangle recomputation and exact-head WARP and hardware checks.
lambirou commented 2026-11-28 00:53:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T00:53:20Z.


@R0Y00 merged the updated codex/native-graphics-integration base 97cde4d5 into this branch at fdae7f16. The PR is clean and mergeable again.

The d3d12_draw.inl conflict was resolved by keeping the new PSO recipe path and re-applying the recovered-geometry and revision cache invalidation to it. The runtime's fixed-mesh capture path is preserved. The native-graphics fixture now respects the new disk-pair precedence; test-only X2W_TEST_NATIVE_GRAPHICS_PREFER_NATIVE and the existing PSO-failure hook force the native candidate for the fallback cases.

Tests at fdae7f16:

  • compiler suite 14/14 in Debug (including native_rtv_variant_{controls,warp,hardware} and native_compile_dxil_watch);
  • runtime draw/indirect/stream/sampler suite 84/84, one WARP capability skip (startup_compute_dispatch_native_warp);
  • Release startup_native_graphics_draw_{warp,hardware} and native_rtv_variant_{warp,hardware} 4/4.

The debug layer was unavailable (0x887a002d). AI was used.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231264971 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7231264971). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T00:53:20Z. --- @R0Y00 merged the updated `codex/native-graphics-integration` base `97cde4d5` into this branch at `fdae7f16`. The PR is clean and mergeable again. The `d3d12_draw.inl` conflict was resolved by keeping the new PSO recipe path and re-applying the recovered-geometry and revision cache invalidation to it. The runtime's fixed-mesh capture path is preserved. The native-graphics fixture now respects the new disk-pair precedence; test-only `X2W_TEST_NATIVE_GRAPHICS_PREFER_NATIVE` and the existing PSO-failure hook force the native candidate for the fallback cases. Tests at `fdae7f16`: - compiler suite 14/14 in Debug (including `native_rtv_variant_{controls,warp,hardware}` and `native_compile_dxil_watch`); - runtime draw/indirect/stream/sampler suite 84/84, one WARP capability skip (`startup_compute_dispatch_native_warp`); - Release `startup_native_graphics_draw_{warp,hardware}` and `native_rtv_variant_{warp,hardware}` 4/4. The debug layer was unavailable (`0x887a002d`). AI was used.
akimfomin commented 2026-11-28 00:54:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by akimfomin on 2026-11-28T00:54:00Z.


PortBridge's saved Git comparison was for the older 4df0929 head. Your rebase at fdae7f16 already resolves that conflict and explicitly forces the native route in the fallback fixture. The published positive and missing-pair controls cover the distinction I intended. No repeat requested.

The cross-project complement remains XCL #2940, where a presented blob is stale but native creation succeeds. That should count one native create and keep that pipeline. In Xbox2Windows the forced create failure is a different outcome and the disk-pair recovery is the positive case. Our recorded comparison. If useful on a different open PR, a maintainer or agent can send the PR URL, target SHA and expected behavior in PortBridge #98.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231272986 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7231272986). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-28T00:54:00Z. --- PortBridge's saved Git comparison was for the older `4df0929` head. Your [rebase at `fdae7f16`](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7231264971) already resolves that conflict and explicitly forces the native route in the fallback fixture. The published positive and missing-pair controls cover the distinction I intended. No repeat requested. The cross-project complement remains [XCL #2940](https://github.com/xcl-dev/xcl/pull/2940), where a presented blob is stale but native creation succeeds. That should count one native create and keep that pipeline. In Xbox2Windows the forced create failure is a different outcome and the disk-pair recovery is the positive case. [Our recorded comparison](https://github.com/akimfomin/PortBridge/tree/2b57ac90d61e3385a521dd70c1b7803bdb65fadc/audit/evidence/decision-followthrough/parallel-ops-wave-two-2026-11-28). If useful on a different open PR, a maintainer or agent can send the PR URL, target SHA and expected behavior in [PortBridge #98](https://github.com/akimfomin/PortBridge/issues/98).
lambirou commented 2026-11-28 01:00:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T01:00:22Z.


@R0Y00 the PSO-failure control now starts with <key>.txt renamed to .pending, so the first draw enters the native path rather than reusing the disk pair. A test-only X2W_TEST_MANIFEST_BEFORE_FALLBACK moves the valid manifest into place only when the failed native candidate asks for its fallback.

The test asserts, in order:

  • the native candidate failed with the injected 0x80004005;
  • the manifest was published before the fallback;
  • the published pair was recovered and drew 16 red pixels;
  • the manifest and both stage blobs kept their bytes and mtimes;
  • native-only mode refused with the pair still pending and left 32 clear pixels;
  • the equivalent RTV-variant control and a missing-manifest refusal.

The test-only forced-native precedence from fdae7f16 is removed; production keeps the disk-first precedence. At b409dc83: 14/14 compiler tests in Debug, 84/84 runtime tests with one WARP capability skip, and 4/4 in Release on WARP and RX 9060 XT. The D3D12 debug layer was unavailable (0x887a002d). AI was used.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231349173 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7231349173). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T01:00:22Z. --- @R0Y00 the PSO-failure control now starts with `<key>.txt` renamed to `.pending`, so the first draw enters the native path rather than reusing the disk pair. A test-only `X2W_TEST_MANIFEST_BEFORE_FALLBACK` moves the valid manifest into place only when the failed native candidate asks for its fallback. The test asserts, in order: - the native candidate failed with the injected `0x80004005`; - the manifest was published before the fallback; - the published pair was recovered and drew 16 red pixels; - the manifest and both stage blobs kept their bytes and mtimes; - native-only mode refused with the pair still pending and left 32 clear pixels; - the equivalent RTV-variant control and a missing-manifest refusal. The test-only forced-native precedence from `fdae7f16` is removed; production keeps the disk-first precedence. At `b409dc83`: 14/14 compiler tests in Debug, 84/84 runtime tests with one WARP capability skip, and 4/4 in Release on WARP and RX 9060 XT. The D3D12 debug layer was unavailable (`0x887a002d`). AI was used.
R0Y00 commented 2026-11-28 01:04:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T01:04:42Z.

Review: CHANGES_REQUESTED


Independent review of fdae7f168a. The PSO fault fixture proves the candidate was attempted and then recovered the published pair. Debug and Release /O2 each had 17 passes and one inbox WARP wave32 skip in the fixed mesh, first native draw, stream, native Dispatch and raw pixel UAV/atomic selection.

The updated RTV flow regresses late manifests. In translation_for_targets, an unavailable variant takes the state != 1 branch on every draw. The following else if (entry->manifest_retry.due(...)) is therefore unreachable in the missing state. With no native worker it republishes the marker and never reads the valid manifest when it appears. The existing startup_mrt_dxc_warp and startup_mrt_dxc_hardware both reproduce this on the exact head: the first and second draws both log no RTV translation after the fixture has published the disk marker and waited 1.1 s. Windows 11 26200.9974, WARP 10.0.26100.9818, RTX 4060 Laptop 32.0.16.1656, debug layer enabled.

Please retain the ordinary retry before the native decision, and keep native compilation one attempt per RTV entry. Keep the new injected-failure controls, and rerun these two existing late-publication controls alongside them.

ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)$'
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6094806432 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#pullrequestreview-6094806432). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T01:04:42Z. **Review:** CHANGES_REQUESTED --- Independent review of fdae7f168ac75bec6dcdceac2871d24ef2202b3a. The PSO fault fixture proves the candidate was attempted and then recovered the published pair. Debug and Release /O2 each had 17 passes and one inbox WARP wave32 skip in the fixed mesh, first native draw, stream, native Dispatch and raw pixel UAV/atomic selection. The updated RTV flow regresses late manifests. In translation_for_targets, an unavailable variant takes the state != 1 branch on every draw. The following else if (entry->manifest_retry.due(...)) is therefore unreachable in the missing state. With no native worker it republishes the marker and never reads the valid manifest when it appears. The existing startup_mrt_dxc_warp and startup_mrt_dxc_hardware both reproduce this on the exact head: the first and second draws both log no RTV translation after the fixture has published the disk marker and waited 1.1 s. Windows 11 26200.9974, WARP 10.0.26100.9818, RTX 4060 Laptop 32.0.16.1656, debug layer enabled. Please retain the ordinary retry before the native decision, and keep native compilation one attempt per RTV entry. Keep the new injected-failure controls, and rerun these two existing late-publication controls alongside them. ```powershell ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)$' ```
R0Y00 commented 2026-11-28 01:11:56 +00:00 (Migrated from github.com)

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


I rechecked b409dc83. The delayed publication inside the fault fixture now proves the intended native-first failure and disk recovery. The normal late RTV publication regression still reproduces separately: both native graphics tests pass, both startup_mrt_dxc tests fail.

A small local resolution passed all four on WARP and RTX. I restored translation_for_targets from #3094 at 97cde4d5, kept only entry->rtv_request = request immediately after entry->key = key, and kept the rest of b409dc83's PSO fallback and fixture changes. This leaves initial translation and marker publication inside the new-entry branch and the existing entry's due retry in its reachable else-if. Reproduction: ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)$'.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231492217 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7231492217). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T01:11:56Z. --- I rechecked b409dc83. The delayed publication inside the fault fixture now proves the intended native-first failure and disk recovery. The normal late RTV publication regression still reproduces separately: both native graphics tests pass, both startup_mrt_dxc tests fail. A small local resolution passed all four on WARP and RTX. I restored translation_for_targets from #3094 at 97cde4d5, kept only entry->rtv_request = request immediately after entry->key = key, and kept the rest of b409dc83's PSO fallback and fixture changes. This leaves initial translation and marker publication inside the new-entry branch and the existing entry's due retry in its reachable else-if. Reproduction: ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)$'.
lambirou commented 2026-11-28 01:12:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T01:12:31Z.


@R0Y00 fixed the late-manifest regression on dbca1851: translation_for_targets now performs the ordinary manifest_retry.due() reload before the native decision. The previous else if sat after an entry->state != 1 branch that is always taken while the variant is unavailable, so it was unreachable. Native compilation remains limited to one attempt per RTV entry.

I ran your exact controls:

ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)$'
  • Debug: 4/4 passed (startup_mrt_dxc_warp, _hardware, startup_native_graphics_draw_warp, _hardware).
  • Release: 6/6 passed, adding native_rtv_variant_warp and _hardware.
  • Broader runtime suite: 84/84 passed, one WARP capability skip; compiler suite 14/14.

The new injected-failure controls still pass. D3D12 debug layer unavailable (0x887a002d). AI was used.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231499266 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7231499266). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T01:12:31Z. --- @R0Y00 fixed the late-manifest regression on `dbca1851`: `translation_for_targets` now performs the ordinary `manifest_retry.due()` reload before the native decision. The previous `else if` sat after an `entry->state != 1` branch that is always taken while the variant is unavailable, so it was unreachable. Native compilation remains limited to one attempt per RTV entry. I ran your exact controls: ```powershell ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)$' ``` - Debug: 4/4 passed (`startup_mrt_dxc_warp`, `_hardware`, `startup_native_graphics_draw_warp`, `_hardware`). - Release: 6/6 passed, adding `native_rtv_variant_warp` and `_hardware`. - Broader runtime suite: 84/84 passed, one WARP capability skip; compiler suite 14/14. The new injected-failure controls still pass. D3D12 debug layer unavailable (`0x887a002d`). AI was used.
R0Y00 commented 2026-11-28 01:21:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T01:21:24Z.

Review: APPROVED


Approved after independent review of dbca1851c5 on runtime base 97cde4d5. The ordinary late RTV retry runs before the one-shot native attempt. The exact head passed the previously failing late-publication control on both adapters. The fault fixture also proves native PSO creation was attempted before the disk pair was published, and checks successful recovery, native-only refusal, unchanged cache files and the RTV variant.

Debug and Release /O2 each passed all six selected source-built tests, no skips. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, WARP 10.0.26100.9818, D3D12 debug layer enabled in the graphics fixtures.

ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^(startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)|native_rtv_variant_(warp|hardware))$'
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6094869512 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#pullrequestreview-6094869512). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T01:21:24Z. **Review:** APPROVED --- Approved after independent review of dbca1851c5a128917c284922b14b1251a287eba4 on runtime base 97cde4d5. The ordinary late RTV retry runs before the one-shot native attempt. The exact head passed the previously failing late-publication control on both adapters. The fault fixture also proves native PSO creation was attempted before the disk pair was published, and checks successful recovery, native-only refusal, unchanged cache files and the RTV variant. Debug and Release /O2 each passed all six selected source-built tests, no skips. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, WARP 10.0.26100.9818, D3D12 debug layer enabled in the graphics fixtures. ```powershell ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^(startup_(mrt_dxc|native_graphics_draw)_(warp|hardware)|native_rtv_variant_(warp|hardware))$' ```
JohnConnorNPC commented 2026-11-28 06:16:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T06:16:48Z.


Thanks for the work on this. One thing blocks merging at dbca1851: the last commit moved the RTV publish and its log line out of the new-entry block. Every draw on an unavailable RTV variant now stats req_<key>.rtv under draw_lock and writes an unbudgeted "no RTV translation" line to stderr and the log file. On the base (97cde4d5) that happened once per entry. The block sits outside #ifdef X2W_NATIVE_SHADERS, so it hits every build, and a variant that never gets translated floods the log for as long as the title draws.

Could you restore translation_for_targets from the base and keep only entry->rtv_request = request, as R0Y00 suggested at 01:11? Two smaller points: the missing-pair, invalid-pair and invalid-PS cases never reach the fallback (they also pass on the base runtime, and "published disk pair pipeline failed" is asserted 0 times), and revision invalidation is still unpinned by a test (the surviving mutants from the earlier review).

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7235194014 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7235194014). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T06:16:48Z. --- Thanks for the work on this. One thing blocks merging at dbca1851: the last commit moved the RTV publish and its log line out of the new-entry block. Every draw on an unavailable RTV variant now stats `req_<key>.rtv` under `draw_lock` and writes an unbudgeted "no RTV translation" line to stderr and the log file. On the base (97cde4d5) that happened once per entry. The block sits outside `#ifdef X2W_NATIVE_SHADERS`, so it hits every build, and a variant that never gets translated floods the log for as long as the title draws. Could you restore `translation_for_targets` from the base and keep only `entry->rtv_request = request`, as R0Y00 suggested at 01:11? Two smaller points: the missing-pair, invalid-pair and invalid-PS cases never reach the fallback (they also pass on the base runtime, and "published disk pair pipeline failed" is asserted 0 times), and revision invalidation is still unpinned by a test (the surviving mutants from the earlier review). This comment was AI-assisted.
lambirou commented 2026-11-28 10:39:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T10:39:44Z.


Fixed at 4b3a4f9a.

  • translation_for_targets is restored from 97cde4d5, with only entry->rtv_request = request added after entry->key = key. The .rtv publish, native attempt and no RTV translation log are back inside the if (!entry) block; an existing entry only reloads on its else if (manifest_retry.due()) retry. A variant that never translates no longer stats the marker or logs on every draw.
  • Added a PSO fallback control where the native candidate fails, then a valid manifest with an uncreatable PS is made ready before fallback. It asserts published disk pair pipeline failed as well as the native failure and the clear target.

Release and Debug: startup_mrt_dxc_{warp,hardware} and startup_native_graphics_draw_{warp,hardware} pass 4/4 each. The new disk-PSO-failure case passes on WARP and the RX 9060 XT.

The revision-invalidation path is still unpinned by a targeted test; I left that as the remaining smaller gap rather than changing the runtime further.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7238039804 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7238039804). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T10:39:44Z. --- Fixed at `4b3a4f9a`. - `translation_for_targets` is restored from `97cde4d5`, with only `entry->rtv_request = request` added after `entry->key = key`. The `.rtv` publish, native attempt and `no RTV translation` log are back inside the `if (!entry)` block; an existing entry only reloads on its `else if (manifest_retry.due())` retry. A variant that never translates no longer stats the marker or logs on every draw. - Added a PSO fallback control where the native candidate fails, then a valid manifest with an uncreatable PS is made ready before fallback. It asserts `published disk pair pipeline failed` as well as the native failure and the clear target. Release and Debug: `startup_mrt_dxc_{warp,hardware}` and `startup_native_graphics_draw_{warp,hardware}` pass 4/4 each. The new disk-PSO-failure case passes on WARP and the RX 9060 XT. The revision-invalidation path is still unpinned by a targeted test; I left that as the remaining smaller gap rather than changing the runtime further.
lambirou commented 2026-11-28 10:49:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T10:49:14Z.


Additional RTV checks on 4b3a4f9a: native_rtv_variant_warp and native_rtv_variant_hardware pass 2/2 in both Debug and Release, alongside the 4/4 MRT/native draw set.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7238143102 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7238143102). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T10:49:14Z. --- Additional RTV checks on `4b3a4f9a`: `native_rtv_variant_warp` and `native_rtv_variant_hardware` pass 2/2 in both Debug and Release, alongside the 4/4 MRT/native draw set.
RonLogic commented 2026-11-28 12:28:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-28T12:28:36Z.


I independently tested 4b3a4f9a1228167a71f19b65020d7747e9470ad8 (tree 34d6209b) on #3094 base 97cde4d5.

Debug and Release each passed 7/7, no skips, on Windows 26300.10075 with the D3D12 debug layer enabled. Adapters were RTX 4070 10de:2786 (driver 32.0.16.2124) and inbox WARP 1414:008c (10.0.26100.10068). DXC was 1.9.2602.17.

  • The forced native PSO failure recovered the disk pair on both adapters and read back 16 red and 16 clear pixels. The RTV-specific pair recovered too. Late manifest publication in the same process still drew.
  • The new control with a valid published manifest and an uncreatable disk PS reported both the injected native failure and published disk pair pipeline failed. It recorded no draw and preserved 32 clear pixels on both adapters.
  • The MRT, native-only, cache preservation and UINT16/SINT16/FLOAT32 variant checks also passed. These results are for the PR's stacked base.
cmake --build --preset <dev-or-release> --target compile_dxil startup_stream_consumer d3d12_xs_shim offscreen_check
ctest --preset <dev-or-release> --no-tests=error -j 1 -V -R '^(startup_native_graphics_draw_(warp|hardware)|startup_mrt_dxc_(warp|hardware)|native_rtv_variant_(controls|warp|hardware))$'

I used Codex to run and verify the local checks.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7239252873 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7239252873). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-28T12:28:36Z. --- I independently tested `4b3a4f9a1228167a71f19b65020d7747e9470ad8` (tree `34d6209b`) on #3094 base `97cde4d5`. Debug and Release each passed **7/7**, no skips, on Windows 26300.10075 with the D3D12 debug layer enabled. Adapters were RTX 4070 `10de:2786` (driver `32.0.16.2124`) and inbox WARP `1414:008c` (`10.0.26100.10068`). DXC was 1.9.2602.17. - The forced native PSO failure recovered the disk pair on both adapters and read back 16 red and 16 clear pixels. The RTV-specific pair recovered too. Late manifest publication in the same process still drew. - The new control with a valid published manifest and an uncreatable disk PS reported both the injected native failure and `published disk pair pipeline failed`. It recorded no draw and preserved 32 clear pixels on both adapters. - The MRT, native-only, cache preservation and UINT16/SINT16/FLOAT32 variant checks also passed. These results are for the PR's stacked base. ```powershell cmake --build --preset <dev-or-release> --target compile_dxil startup_stream_consumer d3d12_xs_shim offscreen_check ctest --preset <dev-or-release> --no-tests=error -j 1 -V -R '^(startup_native_graphics_draw_(warp|hardware)|startup_mrt_dxc_(warp|hardware)|native_rtv_variant_(controls|warp|hardware))$' ``` I used Codex to run and verify the local checks.
lambirou commented 2026-11-28 15:37:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T15:37:54Z.


Refreshed onto the merged native graphics base c23cbc36 (includes #3091/#3094, sampler retirement and fixed-mesh sync). Head: 91d000a9.

  • Kept the translation revision bump and the pre-fallback geometry-flag derivation.
  • Adapted the draw to prepare_draw_sampler_heap(self, ...).
  • Kept the test's byte/mtime snapshots and the full missing/manifest/root PSO fault set.
  • Added a two-draw revision-invalidation control: a test-only revision bump must create a second PSO. Removing the revision from the PSO cache key makes it fail with one pipeline instead of two.

Debug and Release: startup_native_graphics_draw_{warp,hardware}, startup_mrt_dxc_{warp,hardware} and native_rtv_variant_{warp,hardware} pass 6/6 each. #3139 is CLEAN/MERGEABLE at 91d000a9.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7241615059 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7241615059). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T15:37:54Z. --- Refreshed onto the merged native graphics base `c23cbc36` (includes #3091/#3094, sampler retirement and fixed-mesh sync). Head: `91d000a9`. - Kept the translation revision bump and the pre-fallback geometry-flag derivation. - Adapted the draw to `prepare_draw_sampler_heap(self, ...)`. - Kept the test's byte/mtime snapshots and the full missing/manifest/root PSO fault set. - Added a two-draw revision-invalidation control: a test-only revision bump must create a second PSO. Removing the revision from the PSO cache key makes it fail with one pipeline instead of two. Debug and Release: `startup_native_graphics_draw_{warp,hardware}`, `startup_mrt_dxc_{warp,hardware}` and `native_rtv_variant_{warp,hardware}` pass 6/6 each. #3139 is `CLEAN/MERGEABLE` at `91d000a9`.
lambirou commented 2026-11-28 15:42:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T15:42:26Z.


Additional sampler regression on 91d000a9: startup_sampler_heap_{warp,hardware} and startup_inline_sampler_{warp,hardware} pass 4/4 in Release after rebuilding offscreen_check. Two other sampler selections (startup_translated_sampler_bindings, startup_sampler_comparison) are separate executables that are not built in this worktree; they are not failures from this branch.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7241672401 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7241672401). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T15:42:26Z. --- Additional sampler regression on `91d000a9`: `startup_sampler_heap_{warp,hardware}` and `startup_inline_sampler_{warp,hardware}` pass 4/4 in Release after rebuilding `offscreen_check`. Two other sampler selections (`startup_translated_sampler_bindings`, `startup_sampler_comparison`) are separate executables that are not built in this worktree; they are not failures from this branch.
lambirou commented 2026-11-28 15:43:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T15:43:07Z.


Follow-up: I built the two remaining sampler executables. startup_translated_sampler_bindings and startup_sampler_comparison also pass 2/2 in Release. The full available sampler set is now 6/6 on 91d000a9.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7241681610 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7241681610). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T15:43:07Z. --- Follow-up: I built the two remaining sampler executables. `startup_translated_sampler_bindings` and `startup_sampler_comparison` also pass 2/2 in Release. The full available sampler set is now 6/6 on `91d000a9`.
lambirou commented 2026-11-28 15:43:51 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T15:43:51Z.


@R0Y00 #3139 is refreshed on the merged native graphics base c23cbc36 at 91d000a9. It is CLEAN/MERGEABLE and approved. Validation: 6/6 native draw/MRT/RTV in Debug and Release, plus 6/6 sampler checks in Release; the revision-invalidation mutant is pinned and killed. Ready to merge.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7241691033 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7241691033). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T15:43:51Z. --- @R0Y00 #3139 is refreshed on the merged native graphics base `c23cbc36` at `91d000a9`. It is `CLEAN/MERGEABLE` and approved. Validation: 6/6 native draw/MRT/RTV in Debug and Release, plus 6/6 sampler checks in Release; the revision-invalidation mutant is pinned and killed. Ready to merge.
Leyukaka commented 2026-11-28 19:20:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T19:20:59Z.


This merged into codex/native-graphics-integration at 17:58 UTC, after that branch had reached main through #3094 (14:07 UTC), so 7291aef2 is not on main (git merge-base --is-ancestor 7291aef2 origin/main is false on 61ba40d1). #3134 is still open. The commit applies cleanly to current main (git merge-tree --write-tree --merge-base 7291aef2^1 origin/main 7291aef2, 3 files, +298/-44); the draft #3248 includes an earlier revision of this branch.

A carry PR to main is needed. @lambirou, do you want to open it, or should I?

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7244477441 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3139#issuecomment-7244477441). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T19:20:59Z. --- This merged into `codex/native-graphics-integration` at 17:58 UTC, after that branch had reached `main` through #3094 (14:07 UTC), so `7291aef2` is not on `main` (`git merge-base --is-ancestor 7291aef2 origin/main` is false on `61ba40d1`). #3134 is still open. The commit applies cleanly to current `main` (`git merge-tree --write-tree --merge-base 7291aef2^1 origin/main 7291aef2`, 3 files, +298/-44); the draft #3248 includes an earlier revision of this branch. A carry PR to `main` is needed. @lambirou, do you want to open it, or should I?
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!3139
No description provided.