runtime: recover the published disk pair after a failed native candidate PSO #3876

Manually merged
github merged 8 commits from github-bot/gh-3874 into gh-pr/3874/base 2026-12-03 05:36:53 +00:00 AGit
Owner

@⁠Leyukaka on GitHub · 2026-12-02 16:54 UTC · original
Leyukaka:port/3134-pso-recovery → main · +373 −65 · 4 files · 8 commits · merged 2026-12-03 05:32 UTC

Change

Carries #3141 by @⁠lambirou to main with his commits. #3141 was merged into the former integration branch and never reached main; his six commits are kept with their author and messages, rebased onto current main, followed by one commit of ours (05eff6113).

Fixes #3136. Refs #2978 (the remaining main acceptance described in the 12-02 comment).

On main, a null result from native candidate graphics PSO creation went to pipeline_state_unavailable and the draw exited without reloading the published pair. With this change:

  • When the native candidate's PSO fails, pipeline_for falls back to the published disk pair, and bindings are prepared from the translation that pipeline_for leaves in place (@⁠lambirou's commits).
  • If no pair is published yet, the failed candidate stays refused and the runtime looks the published pair up again on the manifest re-read delay, without recreating the candidate PSO. Carried over as is, the fallback cached the null pipeline on main, so a pair published later in the same process never drew. A refused manifest ends the retries (05eff6113).
  • Native-only mode and a missing or invalid pair still refuse with a diagnostic, and the target stays clear.

Fixture (startup_native_graphics_draw, source-built, same process):

  • The failure is injected only for the native candidate (X2W_TEST_NATIVE_GRAPHICS_PSO_FAILURE, gated on the candidate); the disk pair's PSO is created normally.
  • The first draw leaves the target clear (32 clear pixels). After the pair is published, the retry reads back 16 red and 16 clear pixels after the fence.
  • <key>.txt, <key>.vs.cso and <key>.ps.cso keep their bytes and modification times.
  • Controls: native-only refusal, missing pair, invalid manifest, invalid pixel blob, RTV variant fallback and RTV variant without a manifest.

The test hook from #3141 that moved a file from a path given in an environment variable is removed from the runtime; the RTV variant and invalid pixel blob controls now use the consumer's same-process publication instead.

Shared interface touched: pipeline_for and draw_translated in src/startup_stubs/d3d12_draw.inl. Open PRs that edit pipeline_for will conflict with this one.

Verification

Windows, MSVC, exact head 05eff6113, GPU tests run serially.

cmake --build --preset dev --target compile_dxil startup_stream_consumer d3d12_xs_shim
ctest --preset dev --no-tests=error --output-on-failure -j 1 -R "^(startup_native_graphics_draw|startup_mrt_dxc|native_rtv_variant)_(warp|hardware)$|^native_rtv_variant_controls$"
ctest --preset dev --no-tests=error --output-on-failure -j 1 -R "^(startup_indirect_.*|startup_stream_draw.*|startup_indirect_requests)$"
  • startup_native_graphics_draw, startup_mrt_dxc, native_rtv_variant: pass on WARP and on hardware (reported separately by the _warp and _hardware tests).
  • native_rtv_variant_controls, startup_stream_draw, startup_indirect_requests: pass.
  • 40 startup_indirect_* draw, translated, bucket and mesh-cache tests: pass on WARP and on hardware.

Evidence and follow-up

No new fixture files; the existing source-built triangle fixture is extended. All inputs are synthetic and generated by the test.

Known points for review:

  • The PSO is now created before the d16, formatted-buffer, fixed-vertex and indirect checks (057bd7403). An indirect draw that is refused later may create a PSO first, and the order of refusal reasons for indirect draws can change. The indirect suite passes.
  • When a candidate is replaced by the disk pair, the candidate's root signature is intentionally not released, because an already recorded draw may still reference it. This is a small leak per recovered key, documented in the code.
  • Some of @⁠lambirou's commit messages refer to the former integration base; they are kept verbatim.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (none changed)
  • I did not include proprietary files, dumps, distribution links or secrets.
**@⁠Leyukaka** on GitHub · 2026-12-02 16:54 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3874) `Leyukaka:port/3134-pso-recovery` → `main` · +373 −65 · 4 files · 8 commits · merged 2026-12-03 05:32 UTC ## Change Carries #3141 by @⁠lambirou to `main` with his commits. #3141 was merged into the former integration branch and never reached `main`; his six commits are kept with their author and messages, rebased onto current `main`, followed by one commit of ours (`05eff6113`). Fixes #3136. Refs #2978 (the remaining main acceptance described in the [12-02 comment](https://git.gtahub.st/github/R0Y00--Xbox2Windows/issues/2978)). On `main`, a null result from native candidate graphics PSO creation went to `pipeline_state_unavailable` and the draw exited without reloading the published pair. With this change: - When the native candidate's PSO fails, `pipeline_for` falls back to the published disk pair, and bindings are prepared from the translation that `pipeline_for` leaves in place (@⁠lambirou's commits). - If no pair is published yet, the failed candidate stays refused and the runtime looks the published pair up again on the manifest re-read delay, without recreating the candidate PSO. Carried over as is, the fallback cached the null pipeline on `main`, so a pair published later in the same process never drew. A refused manifest ends the retries (`05eff6113`). - Native-only mode and a missing or invalid pair still refuse with a diagnostic, and the target stays clear. Fixture (`startup_native_graphics_draw`, source-built, same process): - The failure is injected only for the native candidate (`X2W_TEST_NATIVE_GRAPHICS_PSO_FAILURE`, gated on the candidate); the disk pair's PSO is created normally. - The first draw leaves the target clear (32 clear pixels). After the pair is published, the retry reads back 16 red and 16 clear pixels after the fence. - `<key>.txt`, `<key>.vs.cso` and `<key>.ps.cso` keep their bytes and modification times. - Controls: native-only refusal, missing pair, invalid manifest, invalid pixel blob, RTV variant fallback and RTV variant without a manifest. The test hook from #3141 that moved a file from a path given in an environment variable is removed from the runtime; the RTV variant and invalid pixel blob controls now use the consumer's same-process publication instead. Shared interface touched: `pipeline_for` and `draw_translated` in `src/startup_stubs/d3d12_draw.inl`. Open PRs that edit `pipeline_for` will conflict with this one. ## Verification Windows, MSVC, exact head `05eff6113`, GPU tests run serially. ``` cmake --build --preset dev --target compile_dxil startup_stream_consumer d3d12_xs_shim ctest --preset dev --no-tests=error --output-on-failure -j 1 -R "^(startup_native_graphics_draw|startup_mrt_dxc|native_rtv_variant)_(warp|hardware)$|^native_rtv_variant_controls$" ctest --preset dev --no-tests=error --output-on-failure -j 1 -R "^(startup_indirect_.*|startup_stream_draw.*|startup_indirect_requests)$" ``` - `startup_native_graphics_draw`, `startup_mrt_dxc`, `native_rtv_variant`: pass on WARP and on hardware (reported separately by the `_warp` and `_hardware` tests). - `native_rtv_variant_controls`, `startup_stream_draw`, `startup_indirect_requests`: pass. - 40 `startup_indirect_*` draw, translated, bucket and mesh-cache tests: pass on WARP and on hardware. ## Evidence and follow-up No new fixture files; the existing source-built triangle fixture is extended. All inputs are synthetic and generated by the test. Known points for review: - The PSO is now created before the d16, formatted-buffer, fixed-vertex and indirect checks (`057bd7403`). An indirect draw that is refused later may create a PSO first, and the order of refusal reasons for indirect draws can change. The indirect suite passes. - When a candidate is replaced by the disk pair, the candidate's root signature is intentionally not released, because an already recorded draw may still reference it. This is a small leak per recovered key, documented in the code. - Some of @⁠lambirou's commit messages refer to the former integration base; they are kept verbatim. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. (none changed) - [x] I did not include proprietary files, dumps, distribution links or secrets.
A native graphics candidate reports ready=1 before pipeline_for creates its
desktop PSO. When CreateGraphicsPipelineState failed, the draw returned null
and cached that result, so the target stayed clear even when a valid published
pair existed in the shader cache.

Reload that pair for the same render-target key, bump a translation revision
so earlier native PSOs are not reused, and refuse the draw with a diagnostic
when the pair is missing or invalid. Native-only mode keeps its explicit
refusal. The published manifest and stage files are read, never rewritten.

Refs #3134
pipeline_for may replace the native candidate with the published disk
translation. Create the PSO before preparing the D16, formatted-buffer and
fixed-vertex bindings so they come from the final translation, and recompute
indexed-rectangle geometry when the fallback changes the fixed stream.

Add the RTV variant fallback and invalid pixel-blob cases.
pipeline_for received only the pre-fallback geometry flag. A direct rectangle
whose native candidate had a fixed vertex stream could therefore recurse into
the published disk pair with that stale flag, and the caller did not retry when
the disk PSO failed.

Pass the rectangle kind and derive the flag from the translation the function
actually holds. Release the replaced candidate blobs before the swap.
Move the valid manifest into place only when the failed native candidate asks
for its fallback. The fixture now proves the native PSO was attempted before
disk reuse, covers native-only refusal with the pair still pending, and checks
the published files stay unchanged. Drop the test-only forced-native
precedence.
Restore translation_for_targets from 97cde4d5 and keep only entry->rtv_request = request. The publish, native attempt and no-translation log now run once when the RTV entry is created; an existing entry only reloads on its due retry. Add a PSO fallback control where the disk pair loads but its PSO cannot be created, and assert the published-disk-pair-pipeline-failed diagnostic.
Add a two-draw fixture and a test-only translation revision bump. The second draw must create a new PSO rather than reuse the first; removing the revision from the PSO cache key makes the test fail (one desktop pipeline instead of two).
On main, a native candidate whose PSO creation failed with no published
pair cached a null pipeline, so a pair published later in the same process
never drew. Keep the failed candidate refused and look for the published
pair again on the manifest retry schedule, without recreating the candidate
PSO. A refused manifest ends the retries; native-only mode still refuses.

The fixture now injects the failure only for the native candidate in the
same-process publication loop: the first target stays clear, the retry reads
back 16 red and 16 clear pixels after the fence, and the manifest and both
stage files keep their bytes and mtimes. The RTV variant and invalid pixel
blob controls use the same publication, which replaces the runtime-side
X2W_TEST_MANIFEST_BEFORE_FALLBACK hook. A missing pair is refused with a
diagnostic. The fixture timeout is 180 s for the added runs.

Refs #3134. Refs #2978.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 19:11:18 +00:00
Author
Owner

@⁠mumba17 on GitHub · 2026-12-02 20:03 UTC · original · reviewed

Reviewed 05eff611 by reading the diff against main 1cd972cd, side by side with #3875 (same #3141 carry, same issue). Not built or run. Comment only: I'm not a maintainer.

Summary. Of the two, this one looks like the better base: it keeps @⁠lambirou's commits, removes the runtime file-move hook, and handles a pair published after the candidate fails. No blocker found. Points below, most important first.

  • SHOULD (shared with #3875, from #3141): the per-draw env read. X2W_TEST_BUMP_TRANSLATION_REVISION is read with x2w_local::env_on on every translated draw, under draw_lock. env_on is uncached (local_log.h:17: GetEnvironmentVariableA plus Get/SetLastError each call), and draws are the hot path. A function-local static const bool, like sync_mesh_requests() in the same file, keeps it a one-time read. X2W_TEST_NATIVE_GRAPHICS_PSO_FAILURE is read only when a candidate's PSO is created, so it's fine as is.
  • QUESTION (shared with #3875): releasing the command signature when the candidate is replaced. The new comment keeps the candidate's root (raw pointer) alive because a recorded list may still use it. But tr = std::move(fallback) also move-assigns indexed_signature, which is a ComPtr<ID3D12CommandSignature> created against the candidate's root (d3d12_draw.inl:2760) and passed to ExecuteIndirect (:4395). In the partial case, the candidate's PSO succeeded for one state key and an indexed indirect draw was recorded, then failed for another. Recovery would then release a signature that an unexecuted list may still reference. The injected failure fails every candidate PSO, so the fixture can't reach this. If the partial case is possible, keeping indexed_signature alongside root (or deferring its release) closes it. If it isn't, a comment saying so would help.
  • NIT: first recovery attempt. recover_published_pair loads through the absent cache. A pair published just before the candidate fails can therefore read as absent until the change feed drains, and the draw then recovers on the first retry (1 s later) instead of immediately. #3875 bypasses the absent cache for this one load (use_absent_cache=false, plus note_cache_write after its own publish). Optional, since the retry already covers it.
  • NIT: the startup_native_graphics_draw_* timeout goes 120 → 180 s with no note on what takes longer. One line in the PR body would help, e.g. the retry wait in the later-publication control.

Checked, no finding:

  • Later publication: load_translation calls manifest_retry.missed() outside the new count gate (:718), so candidate_retry is scheduled even with count=false. due() is false once a manifest is refused (found() clears at), which matches "a refused manifest ends the retries". Until then, a failed candidate returns null before the bound-pipeline cache lookup, so no null PSO is cached for it.
  • Recursion: the fallback has native_candidate=false and revision = old + 1. The recursive pipeline_for therefore can't re-enter recovery and can't reuse a candidate-era cache entry, and recipe replay/recording is skipped while revision is set.
  • geometry_rect is derived from the translation pipeline_for leaves in tr, and draw_translated now creates the PSO before the d16, formatted-buffer and fixed-vertex bindings, so a fallback that drops the fixed stream gets the right key. As your notes say, this moves PSO creation ahead of those refusals for indirect draws.
  • The !tr path keeps indirect && tr for translation_not_ready, as on main. #3875 widens it to indirect.

Compared with #3875 for whoever picks one:

  • Authorship: this PR keeps @⁠lambirou's six commits. #3875 re-applies the change in one commit.
  • Pair published after the failure: handled here (retry on the manifest delay). In #3875, a failed fallback falls through to bound.pipelines[cache_key] = nullptr, so that bound stays null for the rest of the process even after the translator publishes the pair.
  • Runtime test hook: #3875 keeps X2W_TEST_MANIFEST_BEFORE_FALLBACK, which moves <path>.pending to a path taken from the environment inside pipeline_for. This PR removes it and publishes from the consumer.

AI-assisted (Claude Code).

**@⁠mumba17** on GitHub · 2026-12-02 20:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3874#pullrequestreview-6158003737) · **reviewed** Reviewed `05eff611` by reading the diff against `main` `1cd972cd`, side by side with #3875 (same #3141 carry, same issue). Not built or run. Comment only: I'm not a maintainer. **Summary.** Of the two, this one looks like the better base: it keeps @⁠lambirou's commits, removes the runtime file-move hook, and handles a pair published after the candidate fails. No blocker found. Points below, most important first. - **SHOULD (shared with #3875, from #3141): the per-draw env read.** `X2W_TEST_BUMP_TRANSLATION_REVISION` is read with `x2w_local::env_on` on every translated draw, under `draw_lock`. `env_on` is uncached (`local_log.h:17`: `GetEnvironmentVariableA` plus `Get/SetLastError` each call), and draws are the hot path. A function-local `static const bool`, like `sync_mesh_requests()` in the same file, keeps it a one-time read. `X2W_TEST_NATIVE_GRAPHICS_PSO_FAILURE` is read only when a candidate's PSO is created, so it's fine as is. - **QUESTION (shared with #3875): releasing the command signature when the candidate is replaced.** The new comment keeps the candidate's `root` (raw pointer) alive because a recorded list may still use it. But `tr = std::move(fallback)` also move-assigns `indexed_signature`, which is a `ComPtr<ID3D12CommandSignature>` created against the candidate's root (`d3d12_draw.inl:2760`) and passed to `ExecuteIndirect` (`:4395`). In the partial case, the candidate's PSO succeeded for one state key and an indexed indirect draw was recorded, then failed for another. Recovery would then release a signature that an unexecuted list may still reference. The injected failure fails every candidate PSO, so the fixture can't reach this. If the partial case is possible, keeping `indexed_signature` alongside `root` (or deferring its release) closes it. If it isn't, a comment saying so would help. - **NIT: first recovery attempt.** `recover_published_pair` loads through the absent cache. A pair published just before the candidate fails can therefore read as absent until the change feed drains, and the draw then recovers on the first retry (1 s later) instead of immediately. #3875 bypasses the absent cache for this one load (`use_absent_cache=false`, plus `note_cache_write` after its own publish). Optional, since the retry already covers it. - **NIT:** the `startup_native_graphics_draw_*` timeout goes 120 → 180 s with no note on what takes longer. One line in the PR body would help, e.g. the retry wait in the later-publication control. Checked, no finding: - Later publication: `load_translation` calls `manifest_retry.missed()` outside the new `count` gate (`:718`), so `candidate_retry` is scheduled even with `count=false`. `due()` is false once a manifest is refused (`found()` clears `at`), which matches "a refused manifest ends the retries". Until then, a failed candidate returns null before the bound-pipeline cache lookup, so no null PSO is cached for it. - Recursion: the fallback has `native_candidate=false` and `revision = old + 1`. The recursive `pipeline_for` therefore can't re-enter recovery and can't reuse a candidate-era cache entry, and recipe replay/recording is skipped while `revision` is set. - `geometry_rect` is derived from the translation `pipeline_for` leaves in `tr`, and `draw_translated` now creates the PSO before the d16, formatted-buffer and fixed-vertex bindings, so a fallback that drops the fixed stream gets the right key. As your notes say, this moves PSO creation ahead of those refusals for indirect draws. - The `!tr` path keeps `indirect && tr` for `translation_not_ready`, as on `main`. #3875 widens it to `indirect`. Compared with #3875 for whoever picks one: - **Authorship:** this PR keeps @⁠lambirou's six commits. #3875 re-applies the change in one commit. - **Pair published after the failure:** handled here (retry on the manifest delay). In #3875, a failed fallback falls through to `bound.pipelines[cache_key] = nullptr`, so that bound stays null for the rest of the process even after the translator publishes the pair. - **Runtime test hook:** #3875 keeps `X2W_TEST_MANIFEST_BEFORE_FALLBACK`, which moves `<path>.pending` to a path taken from the environment inside `pipeline_for`. This PR removes it and publishes from the consumer. AI-assisted (Claude Code).
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 22:27 UTC · original · reviewed

I checked the trial merge of 05eff611 with main 67862ee4. The two conflict hunks are both in d3d12_draw.inl. Please carry forward #3820's depth-view unbind/rebind helpers and #3823's physical descriptor-table refusal. The latter needs to validate the translation that will actually bind resources after PSO recovery, because pipeline_for can replace tr with the disk pair. Keep the direct-draw and exact guest-root requirements for that final translation. A fallback control that verifies the physical-table refusal would make this merge resolution testable. The other files merge cleanly.

**@⁠R0Y00** on GitHub · 2026-12-02 22:27 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3874#pullrequestreview-6160145910) · **reviewed** I checked the trial merge of `05eff611` with `main` `67862ee4`. The two conflict hunks are both in `d3d12_draw.inl`. Please carry forward #3820's depth-view unbind/rebind helpers and #3823's physical descriptor-table refusal. The latter needs to validate the translation that will actually bind resources after PSO recovery, because `pipeline_for` can replace `tr` with the disk pair. Keep the direct-draw and exact guest-root requirements for that final translation. A fallback control that verifies the physical-table refusal would make this merge resolution testable. The other files merge cleanly.
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-03 04:49 UTC · original

One additional integration point for the #2978 fallback: the trial merge of 05eff611 onto 9dfe168a now also conflicts with #3529 in CMakeLists.txt and tests/startup_native_graphics_draw_check.py. Please keep the shared triangle/environment helpers and the --fixed-slot57 mode and its startup_native_graphics_fixed_entry_{warp,hardware} registrations. The longer timeout for the fallback fixture can coexist with the existing fixed-entry timeout. After the merge, run both the original fixed-entry and the new later-publication tests on the same build. The earlier depth rebind and final-translation physical-table checks still apply.

**@⁠R0Y00** on GitHub · 2026-12-03 04:49 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3874#issuecomment-7368083795) One additional integration point for the #2978 fallback: the trial merge of `05eff611` onto `9dfe168a` now also conflicts with #3529 in `CMakeLists.txt` and `tests/startup_native_graphics_draw_check.py`. Please keep the shared triangle/environment helpers and the `--fixed-slot57` mode and its `startup_native_graphics_fixed_entry_{warp,hardware}` registrations. The longer timeout for the fallback fixture can coexist with the existing fixed-entry timeout. After the merge, run both the original fixed-entry and the new later-publication tests on the same build. The earlier depth rebind and final-translation physical-table checks still apply.
github-bot force-pushed github-bot/gh-3874 from 05eff61132 to f5c75f6d8a 2026-12-03 05:23:13 +00:00 Compare
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-03 05:14 UTC · original · reviewed

I tried 05eff611 on main 9dfe168a (local tree 48afc66070f90f7ffa1a12464b3406c95e23834d). The resolution keeps the depth-view unbind/rebind helpers and both fixed-entry test registrations. It keeps the 180-second fallback timeout and the 120-second fixed-entry timeout. The physical-table root check runs on the translation returned by pipeline_for, before bindings are prepared.

MSVC Debug, Windows build 26300, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, debug layer enabled: ctest --preset dev --no-tests=error -j 1 -V -R '^startup_native_graphics_(draw|fixed_entry)_(warp|hardware)$' passed 4/4, and '^startup_slot67_indirect_dispatch_(warp|hardware)$' passed 2/2. No capability skips. On both adapters the source-built ordinary cold/hot draw read back 16 red and 16 clear pixels. With native PSO creation faulted, the first draw stayed clear and the same-process retry after publication produced the expected pixels. The existing cache-byte and timestamp checks and missing/invalid pair and native-only controls passed.

Separately, I marked only the recovered pair as physical_tables immediately after its successful PSO in a temporary diagnostic. In the same fixture, behind a mismatched guest root, both adapters logged the final-translation root refusal and left all 32 pixels clear on both attempts. This isolates the guard ordering. A full physical-table manifest fixture, the just-published-before-fallback case from #3875, and the command signature lifetime review remain open. The diagnostic was restored and no branch was pushed.

**@⁠R0Y00** on GitHub · 2026-12-03 05:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3874#pullrequestreview-6164070036) · **reviewed** I tried `05eff611` on `main` `9dfe168a` (local tree `48afc66070f90f7ffa1a12464b3406c95e23834d`). The resolution keeps the depth-view unbind/rebind helpers and both fixed-entry test registrations. It keeps the 180-second fallback timeout and the 120-second fixed-entry timeout. The physical-table root check runs on the translation returned by `pipeline_for`, before bindings are prepared. MSVC Debug, Windows build 26300, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, debug layer enabled: `ctest --preset dev --no-tests=error -j 1 -V -R '^startup_native_graphics_(draw|fixed_entry)_(warp|hardware)$'` passed 4/4, and `'^startup_slot67_indirect_dispatch_(warp|hardware)$'` passed 2/2. No capability skips. On both adapters the source-built ordinary cold/hot draw read back 16 red and 16 clear pixels. With native PSO creation faulted, the first draw stayed clear and the same-process retry after publication produced the expected pixels. The existing cache-byte and timestamp checks and missing/invalid pair and native-only controls passed. Separately, I marked only the recovered pair as `physical_tables` immediately after its successful PSO in a temporary diagnostic. In the same fixture, behind a mismatched guest root, both adapters logged the final-translation root refusal and left all 32 pixels clear on both attempts. This isolates the guard ordering. A full physical-table manifest fixture, the just-published-before-fallback case from #3875, and the command signature lifetime review remain open. The diagnostic was restored and no branch was pushed.
Author
Owner

@⁠Leyukaka on GitHub · 2026-12-03 05:20 UTC · original

Thanks. Rebased onto 9dfe168a0 (new head f5c75f6d8). Both conflicts with #3529 are resolved as a union:

  • tests/startup_native_graphics_draw_check.py: triangle_program(), graphics_env(), CLEAR and the --fixed-slot57 mode are kept as they are on main. The fallback fixture now builds its environment from the shared helper, dict(graphics_env(sdk, cache), X2W_NATIVE_SHADERS_ONLY="0") (:102).
  • CMakeLists.txt: the startup_native_graphics_fixed_entry_{warp,hardware} registrations are kept with --fixed-slot57 and TIMEOUT 120 (:2183-2186). startup_native_graphics_draw_{warp,hardware} uses TIMEOUT 180 for the later-publication cases (:2182). That one value is the PR's only change to this file.

The earlier checks are still in place after the rebase (src/startup_stubs/d3d12_draw.inl):

  • Depth rebind: depth_target_rebind (:1796) still runs after a depth-unbound draw (:4537).
  • Final-translation physical tables: physical_tables_refused (:3762) runs before the PSO (:3827) and again on the translation that pipeline_for leaves in place when a recovered pair raises the revision (:3838).

The points from @⁠mumba17's review are in f5c75f6d8: the candidate's command signature is retained on recovery (:1824-1828), X2W_TEST_BUMP_TRANSLATION_REVISION is read once (:3775), and the recovery load bypasses the absent cache (:709, :1814).

Validation on Windows (MSVC), WARP and a hardware adapter, one build of f5c75f6d8 for all tests:

Test WARP Hardware
startup_native_graphics_fixed_entry_* (original fixed-entry) pass pass
startup_native_graphics_draw_* (later-publication controls) pass pass

16 of the 21 tests in the set passed. The 5 failures are not from this PR:

  • startup_indirect_translated_draw_{warp,hardware}
  • startup_indirect_translated_refusal_census_{warp,hardware,control_warp}

These five fail the same way on unmodified main since #3778. The fix is in #3892, which is under review. I can rerun the full set on top of #3892 once it lands.

**@⁠Leyukaka** on GitHub · 2026-12-03 05:20 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3874#issuecomment-7368634680) Thanks. Rebased onto `9dfe168a0` (new head `f5c75f6d8`). Both conflicts with #3529 are resolved as a union: - `tests/startup_native_graphics_draw_check.py`: `triangle_program()`, `graphics_env()`, `CLEAR` and the `--fixed-slot57` mode are kept as they are on main. The fallback fixture now builds its environment from the shared helper, `dict(graphics_env(sdk, cache), X2W_NATIVE_SHADERS_ONLY="0")` (`:102`). - `CMakeLists.txt`: the `startup_native_graphics_fixed_entry_{warp,hardware}` registrations are kept with `--fixed-slot57` and `TIMEOUT 120` (`:2183-2186`). `startup_native_graphics_draw_{warp,hardware}` uses `TIMEOUT 180` for the later-publication cases (`:2182`). That one value is the PR's only change to this file. The earlier checks are still in place after the rebase (`src/startup_stubs/d3d12_draw.inl`): - Depth rebind: `depth_target_rebind` (`:1796`) still runs after a depth-unbound draw (`:4537`). - Final-translation physical tables: `physical_tables_refused` (`:3762`) runs before the PSO (`:3827`) and again on the translation that `pipeline_for` leaves in place when a recovered pair raises the revision (`:3838`). The points from @⁠mumba17's review are in `f5c75f6d8`: the candidate's command signature is retained on recovery (`:1824-1828`), `X2W_TEST_BUMP_TRANSLATION_REVISION` is read once (`:3775`), and the recovery load bypasses the absent cache (`:709`, `:1814`). Validation on Windows (MSVC), WARP and a hardware adapter, one build of `f5c75f6d8` for all tests: | Test | WARP | Hardware | | --- | --- | --- | | `startup_native_graphics_fixed_entry_*` (original fixed-entry) | pass | pass | | `startup_native_graphics_draw_*` (later-publication controls) | pass | pass | 16 of the 21 tests in the set passed. The 5 failures are not from this PR: - `startup_indirect_translated_draw_{warp,hardware}` - `startup_indirect_translated_refusal_census_{warp,hardware,control_warp}` These five fail the same way on unmodified main since #3778. The fix is in #3892, which is under review. I can rerun the full set on top of #3892 once it lands.
github-bot changed target branch from main to gh-pr/3874/base 2026-12-03 05:36:50 +00:00
github manually merged commit f5c75f6d8a into gh-pr/3874/base 2026-12-03 05:36:53 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-03 05:32 UTC · original · approved these changes

Independently re-reviewed f5c75f6d in a clean trial merge onto 2a280a94 (tree ca6c7bcf6263d44cd48eb85b43201cac1a26d355). The code preserves the fixed-entry fixtures and depth rebind, retains the earlier indexed command signature alongside its root, bypasses the absent-cache lookup during recovery, and checks the physical-table root both before PSO creation and on the replacement translation. MSVC Debug ctest --preset dev --no-tests=error -j 1 -V -R '^startup_(native_graphics_(draw|fixed_entry)|slot67_indirect_dispatch)_(warp|hardware)$' passed 6/6. The same five indirect translated draw/refusal-census tests failed on unmodified main and this trial, with the same missing sampled view and refusal-count diagnostics. No capability skips. Windows 11 build 26300, WARP 10.0.26100.9818, RTX 4060 Laptop 32.0.16.1656, debug layer enabled.

For the other publication timing, a local deterministic diagnostic published the source-built pair immediately before the first recovery lookup and simulated a stale negative cache. Both adapters read the pair on that lookup, fenced 16 red and 16 clear pixels, and preserved the cache bytes and mtimes. Re-enabling only the old cache lookup produced 32 clear pixels on both adapters. I restored all diagnostic edits.

**@⁠R0Y00** on GitHub · 2026-12-03 05:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3874#pullrequestreview-6164207705) · **approved these changes** Independently re-reviewed `f5c75f6d` in a clean trial merge onto `2a280a94` (tree `ca6c7bcf6263d44cd48eb85b43201cac1a26d355`). The code preserves the fixed-entry fixtures and depth rebind, retains the earlier indexed command signature alongside its root, bypasses the absent-cache lookup during recovery, and checks the physical-table root both before PSO creation and on the replacement translation. MSVC Debug `ctest --preset dev --no-tests=error -j 1 -V -R '^startup_(native_graphics_(draw|fixed_entry)|slot67_indirect_dispatch)_(warp|hardware)$'` passed 6/6. The same five indirect translated draw/refusal-census tests failed on unmodified main and this trial, with the same missing sampled view and refusal-count diagnostics. No capability skips. Windows 11 build 26300, WARP 10.0.26100.9818, RTX 4060 Laptop 32.0.16.1656, debug layer enabled. For the other publication timing, a local deterministic diagnostic published the source-built pair immediately before the first recovery lookup and simulated a stale negative cache. Both adapters read the pair on that lookup, fenced 16 red and 16 clear pixels, and preserved the cache bytes and mtimes. Re-enabling only the old cache lookup produced 32 clear pixels on both adapters. I restored all diagnostic edits.
This discussion has been locked. Commenting is limited to contributors.
No description provided.