D3D12.X: cover tile mappings whose Signal failed #3566

Merged
lucsoft merged 2 commits from upstream-pr/3566 into main 2026-12-02 12:11:56 +00:00
lucsoft commented 2026-12-01 09:30:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-01T09:30:49Z.


vram's tile-mapping queue raised its value and then signalled it, ignoring the result. When that Signal failed, the value was one no Signal would ever reach: every queue's next submit waited for it (before_execute), and a retired texture's NULL unmap counted as done although nothing marked it. This makes the value move only when the Signal was queued, and gives every mapping whose Signal failed a later one before anything counts on it. It is split out of #3553 (asked for in its review): it applies on every platform, while #3553 is Wine-on-AMD only.

Related: #3553 builds on this (its spares and new placements count on a Signal reaching their mappings). #3010 (draft) changes the same Signal lines to signal once before the next title work; with signal_now that single Signal would get this failure handling too.

What is in it (vram.rs, plus the callers of before_execute)

  • Pages::signal_now advances value only after the Signal was queued and reports a failure; map and unmap_range go through it. A mapping or unmapping whose Signal failed leaves the pages unmarked.
  • Pages::mark gives the value that covers every mapping queued so far: value, or a new Signal when one is unmarked. before_execute calls it after release_held_unmaps (which can queue a NULL unmap of its own) and has the title's queue wait for that value.
  • recycle_ready queues a retired texture with that mark, or UNMARKED when no Signal can be queued; drain_recycled gives such textures a later mark before they can return to the pool.
  • A title queue's cached mapping mark advances only after its Wait succeeds. An upload that cannot establish mapping readiness blocks the title's submission, including lazy level updates made after the initial mapping check.
  • When no Signal can be queued at all, before_execute returns false: the submission is not made and the title stops with that cause (PreparationOutcome::MappingUnmarked: "could not queue a Signal or Wait for texture page mappings"), following the existing fail-closed rule in prepare_title_submission, instead of going out with mappings nothing covers. The GPU content probe returns an error.
  • Tests: a failed Signal leaves the value a Signal reached (and the fence reaches it). With the mapping queue held behind a test fence: a bind whose Signal fails gets mark N+1 at the next before_execute, and the title's work waits for it; with no Signal at all before_execute returns false; a held unmap that becomes releasable inside before_execute with its NULL mapping's Signal failing gets a later mark, and the work waits for it; a retired texture whose unmap's Signal and the retry fail stays out of the pool until a later mark completes. Signal failures are injected through a test-only counter (FAIL_SIGNALS). The same test injects a failed consumer Wait and verifies that the next attempt still waits for the replacement mark.

Tested

  • AMD Radeon RX 7800 XT, Mesa RADV, Ryzen 7 7800X3D, Wine. Windows GNU release builds of the runtime and workspace test binaries completed.
  • Four-thread hle::d3d12x::vram::tests:: run on this head under Wine: ok. 71 passed; 0 failed; 1 ignored; 0 measured; 2702 filtered out; finished in 2.58s
  • Windows 11 / RTX 5070 Ti at f5a57437: 2,906 passed, 0 failed, 51 ignored in the four-thread workspace suite. Test report

Regression run

Both runs below were made with -Title <game name>; after the runs that flag was dropped from our wrapper, and the title: line of both blocks now shows smoke.ps1's default label instead (f651e787, the hash of the game folder's name). Nothing else in the blocks was changed; the runs are the same.

main:

xcl-smoke v1
commit: 86e86fcb33f94fa5d0c809d9b50af7b84bf49cce
gpu: AMD Radeon RX 7800 XT (RADV NAVI32)
title: f651e787
seconds: 60
exit: 0x0
frames shown: 1489 (PresentX 1489)
presents per 2 s (last 3): 59 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

PR:

xcl-smoke v1
commit: 94b0d76108c326118783374a8a1fc7e5568a4129
gpu: AMD Radeon RX 7800 XT (RADV NAVI32)
title: f651e787
seconds: 60
exit: 0x0
frames shown: 1508 (PresentX 1508)
presents per 2 s (last 3): 59 59 61
device removals: 0
crashes: 0
peak commit: 0 MB

The PR's kernel log recorded 0 page faults, 0 ring timeouts, 0 ring resets, 0 coredumps, 0 bus losses.

The 180 s standalone RADV run of this head lost the device at about 158 s after three kernel page faults and a gfx ring timeout. The preceding head showed the same failure pattern in two runs. The follow-up above covers startup. The full #3553 stack completed 180 s on the same host without a page fault.

Not tested

  • Native Windows GPU suite on this head.
  • A driver-generated mapping Signal or Wait failure. The regression test injects failures.
  • Wine reports peak commit as 0 MB in this comparison.

AI use

  • Codex, GPT-6.2 Sol: addressed review findings in #3566, rebased #3553, and verified the revised stack.
  • Claude Code, Claude Opus 5.5: analysis, the code, tests and this description; reviewed by me.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5582887379 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566). Originally posted by [lucsoft](https://github.com/lucsoft) on 2026-12-01T09:30:49Z. --- vram's tile-mapping queue raised its value and then signalled it, ignoring the result. When that Signal failed, the value was one no Signal would ever reach: every queue's next submit waited for it (`before_execute`), and a retired texture's NULL unmap counted as done although nothing marked it. This makes the value move only when the Signal was queued, and gives every mapping whose Signal failed a later one before anything counts on it. It is split out of #3553 (asked for in its review): it applies on every platform, while #3553 is Wine-on-AMD only. **Related:** #3553 builds on this (its spares and new placements count on a Signal reaching their mappings). #3010 (draft) changes the same Signal lines to signal once before the next title work; with `signal_now` that single Signal would get this failure handling too. **What is in it** (`vram.rs`, plus the callers of `before_execute`) - `Pages::signal_now` advances `value` only after the Signal was queued and reports a failure; `map` and `unmap_range` go through it. A mapping or unmapping whose Signal failed leaves the pages `unmarked`. - `Pages::mark` gives the value that covers every mapping queued so far: `value`, or a new Signal when one is `unmarked`. `before_execute` calls it after `release_held_unmaps` (which can queue a NULL unmap of its own) and has the title's queue wait for that value. - `recycle_ready` queues a retired texture with that mark, or `UNMARKED` when no Signal can be queued; `drain_recycled` gives such textures a later mark before they can return to the pool. - A title queue's cached mapping mark advances only after its Wait succeeds. An upload that cannot establish mapping readiness blocks the title's submission, including lazy level updates made after the initial mapping check. - When no Signal can be queued at all, `before_execute` returns false: the submission is not made and the title stops with that cause (`PreparationOutcome::MappingUnmarked`: "could not queue a Signal or Wait for texture page mappings"), following the existing fail-closed rule in `prepare_title_submission`, instead of going out with mappings nothing covers. The GPU content probe returns an error. - Tests: a failed Signal leaves the value a Signal reached (and the fence reaches it). With the mapping queue held behind a test fence: a bind whose Signal fails gets mark N+1 at the next `before_execute`, and the title's work waits for it; with no Signal at all `before_execute` returns false; a held unmap that becomes releasable inside `before_execute` with its NULL mapping's Signal failing gets a later mark, and the work waits for it; a retired texture whose unmap's Signal and the retry fail stays out of the pool until a later mark completes. Signal failures are injected through a test-only counter (`FAIL_SIGNALS`). The same test injects a failed consumer Wait and verifies that the next attempt still waits for the replacement mark. **Tested** - AMD Radeon RX 7800 XT, Mesa RADV, Ryzen 7 7800X3D, Wine. Windows GNU release builds of the runtime and workspace test binaries completed. - Four-thread `hle::d3d12x::vram::tests::` run on this head under Wine: ok. 71 passed; 0 failed; 1 ignored; 0 measured; 2702 filtered out; finished in 2.58s - Windows 11 / RTX 5070 Ti at `f5a57437`: 2,906 passed, 0 failed, 51 ignored in the four-thread workspace suite. [Test report](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7324852132) **Regression run** Both runs below were made with `-Title <game name>`; after the runs that flag was dropped from our wrapper, and the `title:` line of both blocks now shows `smoke.ps1`'s default label instead (`f651e787`, the hash of the game folder's name). Nothing else in the blocks was changed; the runs are the same. main: ``` xcl-smoke v1 commit: 86e86fcb33f94fa5d0c809d9b50af7b84bf49cce gpu: AMD Radeon RX 7800 XT (RADV NAVI32) title: f651e787 seconds: 60 exit: 0x0 frames shown: 1489 (PresentX 1489) presents per 2 s (last 3): 59 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` PR: ``` xcl-smoke v1 commit: 94b0d76108c326118783374a8a1fc7e5568a4129 gpu: AMD Radeon RX 7800 XT (RADV NAVI32) title: f651e787 seconds: 60 exit: 0x0 frames shown: 1508 (PresentX 1508) presents per 2 s (last 3): 59 59 61 device removals: 0 crashes: 0 peak commit: 0 MB ``` The PR's kernel log recorded 0 page faults, 0 ring timeouts, 0 ring resets, 0 coredumps, 0 bus losses. The 180 s standalone RADV run of this head lost the device at about 158 s after three kernel page faults and a gfx ring timeout. The preceding head showed the same failure pattern in two runs. The follow-up above covers startup. The full #3553 stack completed 180 s on the same host without a page fault. **Not tested** - Native Windows GPU suite on this head. - A driver-generated mapping Signal or Wait failure. The regression test injects failures. - Wine reports peak commit as 0 MB in this comparison. **AI use** - Codex, GPT-6.2 Sol: addressed review findings in #3566, rebased #3553, and verified the revised stack. - Claude Code, Claude Opus 5.5: analysis, the code, tests and this description; reviewed by me. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Foniass commented 2026-12-01 09:39:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:39:05Z.


Review (head 69700342, diff read, not a merge-check; draft, PR description red: the smoke block is TODO-SMOKE):

  • It conflicts with #3553 in title_textures.rs ~2066. This PR returns MappingUnmarked there; #3553 returns RetryRequired, which ends the title with the misleading "still failed after bounded retries" message I noted on #3553. The vram.rs hunks are the same code and auto-merge. Landing this first and rebasing #3553 onto it, without #3553's copy, keeps the better stop reason.
  • It was tested only under Wine / RADV. There's no Windows suite run and no smoke pair yet.
  • A Signal that fails without device removal is in practice an out-of-memory case. A removed device is caught first by stop_if_device_removed() in prepare_title_submission. Only injected failures were tested, as the description says.
  • Nit: the new arm in list_x.rs ~3622 can't run, because sparse::before_execute never returns MappingUnmarked; it only makes the match complete. As on main, mapped_after_wait never calls vram::before_execute.
  • The tests check XCL's bookkeeping through FAIL_SIGNALS, which skips the native Signal; they don't exercise a real driver failure. That is the right injection point for this bug.

Fine:

  • The covered value moves only after a Signal is actually queued (signal_now, vram.rs ~1961), so no queue waits for a value nothing will signal. That was the hang on main.
  • The retry Signal goes on the same in-order mapping queue, and the title queue waits for it (~2841).
  • mark() runs after release_held_unmaps, so a queued NULL unmap is covered too.
  • Heap reclaim waits while a mapping is uncovered (~2849), and recycled textures stay out of the pool until a later Signal covers them.
  • When no Signal is possible at all, the title stops with a correct message.
  • The normal path is unchanged apart from a flag write and a scan that returns at once.

#3010 rewrites the same Signal lines, so the two will conflict.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7307007217 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7307007217). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:39:05Z. --- Review (head 69700342, diff read, not a merge-check; draft, `PR description` red: the smoke block is `TODO-SMOKE`): - **It conflicts with #3553** in `title_textures.rs` ~2066. This PR returns `MappingUnmarked` there; #3553 returns `RetryRequired`, which ends the title with the misleading "still failed after bounded retries" message I noted on #3553. The `vram.rs` hunks are the same code and auto-merge. Landing this first and rebasing #3553 onto it, without #3553's copy, keeps the better stop reason. - It was tested only under Wine / RADV. There's no Windows suite run and no smoke pair yet. - A Signal that fails without device removal is in practice an out-of-memory case. A removed device is caught first by `stop_if_device_removed()` in `prepare_title_submission`. Only injected failures were tested, as the description says. - Nit: the new arm in `list_x.rs` ~3622 can't run, because `sparse::before_execute` never returns `MappingUnmarked`; it only makes the match complete. As on main, `mapped_after_wait` never calls `vram::before_execute`. - The tests check XCL's bookkeeping through `FAIL_SIGNALS`, which skips the native Signal; they don't exercise a real driver failure. That is the right injection point for this bug. Fine: - The covered value moves only after a Signal is actually queued (`signal_now`, `vram.rs` ~1961), so no queue waits for a value nothing will signal. That was the hang on main. - The retry Signal goes on the same in-order mapping queue, and the title queue waits for it (~2841). - `mark()` runs after `release_held_unmaps`, so a queued NULL unmap is covered too. - Heap reclaim waits while a mapping is uncovered (~2849), and recycled textures stay out of the pool until a later Signal covers them. - When no Signal is possible at all, the title stops with a correct message. - The normal path is unchanged apart from a flag write and a scan that returns at once. #3010 rewrites the same Signal lines, so the two will conflict. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
lucsoft commented 2026-12-01 09:50:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-01T09:50:34Z.


Thanks. Since your review: the smoke block is in (69700342, 2289 frames, clean) and it is out of draft. #3553 is now stacked on this PR (db57f30c on 69700342) without its own copy, so it gets MappingUnmarked and the right stop message. The list_x arm is there only to make the match complete; mapped_after_wait still never calls vram::before_execute. I left it rather than push a new head for a line that cannot run.

<!-- greyfinch-sync:ivall/xcl:comment:7307285867 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7307285867). Originally posted by [lucsoft](https://github.com/lucsoft) on 2026-12-01T09:50:34Z. --- Thanks. Since your review: the smoke block is in (69700342, 2289 frames, clean) and it is out of draft. #3553 is now stacked on this PR (db57f30c on 69700342) without its own copy, so it gets `MappingUnmarked` and the right stop message. The `list_x` arm is there only to make the match complete; `mapped_after_wait` still never calls `vram::before_execute`. I left it rather than push a new head for a line that cannot run.
mokkamokacaffe commented 2026-12-01 09:54:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mokkamokacaffe on 2026-12-01T09:54:11Z.


Native Windows / NVIDIA verification for #3566

Tested PR head 69700342ee0b67429a4dbdb771cffa5d708bfde6 and used its exact upstream parent 86e86fcb33f94fa5d0c809d9b50af7b84bf49cce for the smoke comparison. The PR head still matched after testing.

Windows 11 24H2 build 26100.9711, Intel Core i9-14900KF, NVIDIA GeForce RTX 4080 SUPER, driver 621.40, Rust 1.100.0 (x86_64-pc-windows-msvc). Workspace tests used the debug profile. Both smokes used release builds.

Tested

  • Both new tests selected exactly one test apiece and ran without a skip. A failed mapping-queue Signal preserved the last reachable fence value. Queued work waited for a successful retry, submission was refused while no mark could be obtained, and a retired texture only returned to the pool after its replacement mark completed.
  • The PR workspace built. The four-thread workspace suite reported 2,891 passed, 0 failed, 51 ignored across 43 harnesses. The focused reruns are separate. The passing totals include 24 explicit skip messages: 22 for lack of wave64 and two for disabled heap windows. Private sample environment variables were unset.
  • All eight uma_driver tests, the placed-texture pixel preservation test, all three stream_recheck_* tests, and the root-signature serialization test flagged in the Wine report passed on this machine.
  • All 73 benchmark cases passed in test mode. No benchmark timings were collected.

Commands from the PR worktree:

cargo build --workspace
cargo test -p xcl --lib hle::d3d12x::vram::tests::a_failed_signal_leaves_the_value_a_signal_reached -- --exact --nocapture
cargo test -p xcl --lib hle::d3d12x::vram::tests::mappings_whose_signal_failed_get_a_later_mark_before_use -- --exact --nocapture
cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture
cargo bench -p xcl --bench '*' -- --test

Regression run

Each clean worktree used its own cargo build --release -p xcl binary and scripts/smoke.ps1. The parent ran first. Both runs used the same local title for 180 seconds with networking and preparation disabled, the same DXC and Agility SDK, and separate empty XCL data and shader cache directories. The PR showed 102.1% of the parent's frames and 99.7% of its peak commit, meeting the repository's 80% frame minimum and 125% memory ceiling.

Main (exact parent)

xcl-smoke v1
commit: 86e86fcb33f94fa5d0c809d9b50af7b84bf49cce
gpu: NVIDIA GeForce RTX 4080 SUPER
title: retail-local
seconds: 180
exit: 0x0
frames shown: 5146 (PresentX 5146)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16543 MB

PR head

xcl-smoke v1
commit: 69700342ee0b67429a4dbdb771cffa5d708bfde6
gpu: NVIDIA GeForce RTX 4080 SUPER
title: retail-local
seconds: 180
exit: 0x0
frames shown: 5252 (PresentX 5252)
presents per 2 s (last 3): 60 60 59
device removals: 0
crashes: 0
peak commit: 16499 MB

Not tested

A spontaneous mapping-queue Signal failure on the NVIDIA driver remains unverified. The focused tests injected failures. The smoke pair checks ordinary execution; it does not establish a performance improvement.

AI use

OpenAI Codex ran the local builds, tests, and smokes, checked the logs, and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7307374919 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7307374919). Originally posted by [mokkamokacaffe](https://github.com/mokkamokacaffe) on 2026-12-01T09:54:11Z. --- ## Native Windows / NVIDIA verification for #3566 Tested PR head `69700342ee0b67429a4dbdb771cffa5d708bfde6` and used its exact upstream parent `86e86fcb33f94fa5d0c809d9b50af7b84bf49cce` for the smoke comparison. The PR head still matched after testing. Windows 11 24H2 build 26100.9711, Intel Core i9-14900KF, NVIDIA GeForce RTX 4080 SUPER, driver 621.40, Rust 1.100.0 (x86_64-pc-windows-msvc). Workspace tests used the debug profile. Both smokes used release builds. **Tested** - Both new tests selected exactly one test apiece and ran without a skip. A failed mapping-queue Signal preserved the last reachable fence value. Queued work waited for a successful retry, submission was refused while no mark could be obtained, and a retired texture only returned to the pool after its replacement mark completed. - The PR workspace built. The four-thread workspace suite reported **2,891 passed, 0 failed, 51 ignored** across 43 harnesses. The focused reruns are separate. The passing totals include 24 explicit skip messages: 22 for lack of wave64 and two for disabled heap windows. Private sample environment variables were unset. - All eight `uma_driver` tests, the placed-texture pixel preservation test, all three `stream_recheck_*` tests, and the root-signature serialization test flagged in the Wine report passed on this machine. - All 73 benchmark cases passed in test mode. No benchmark timings were collected. Commands from the PR worktree: ```powershell cargo build --workspace cargo test -p xcl --lib hle::d3d12x::vram::tests::a_failed_signal_leaves_the_value_a_signal_reached -- --exact --nocapture cargo test -p xcl --lib hle::d3d12x::vram::tests::mappings_whose_signal_failed_get_a_later_mark_before_use -- --exact --nocapture cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture cargo bench -p xcl --bench '*' -- --test ``` **Regression run** Each clean worktree used its own `cargo build --release -p xcl` binary and `scripts/smoke.ps1`. The parent ran first. Both runs used the same local title for 180 seconds with networking and preparation disabled, the same DXC and Agility SDK, and separate empty XCL data and shader cache directories. The PR showed 102.1% of the parent's frames and 99.7% of its peak commit, meeting the repository's 80% frame minimum and 125% memory ceiling. Main (exact parent) ``` xcl-smoke v1 commit: 86e86fcb33f94fa5d0c809d9b50af7b84bf49cce gpu: NVIDIA GeForce RTX 4080 SUPER title: retail-local seconds: 180 exit: 0x0 frames shown: 5146 (PresentX 5146) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16543 MB ``` PR head ``` xcl-smoke v1 commit: 69700342ee0b67429a4dbdb771cffa5d708bfde6 gpu: NVIDIA GeForce RTX 4080 SUPER title: retail-local seconds: 180 exit: 0x0 frames shown: 5252 (PresentX 5252) presents per 2 s (last 3): 60 60 59 device removals: 0 crashes: 0 peak commit: 16499 MB ``` **Not tested** A spontaneous mapping-queue Signal failure on the NVIDIA driver remains unverified. The focused tests injected failures. The smoke pair checks ordinary execution; it does not establish a performance improvement. **AI use** OpenAI Codex ran the local builds, tests, and smokes, checked the logs, and prepared this report.
Foniass commented 2026-12-01 10:17:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:17:50Z.


Triage (#1607) – head 6970034

#3553 contains this PR's commit (6970034) and is stacked on it; this is the split-out base requested in #3553's review, not a duplicate. #3010 changes the same Signal lines to signal once per title submission, which is a different change.
No problems found in the diff. vram.rs:Pages::signal_now advances value only after a Signal is queued; mark and mark_pending_recycles cover unmarked mappings before before_execute or the reserved pool depend on them; and every non-test caller of vram::before_execute now handles the false return (title_textures.rs refresh_parts, submit_on, probe_gpu_content).
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7307969713 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7307969713). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T10:17:50Z. --- **Triage (#1607)** – head 6970034 #3553 contains this PR's commit (6970034) and is stacked on it; this is the split-out base requested in #3553's review, not a duplicate. #3010 changes the same Signal lines to signal once per title submission, which is a different change. No problems found in the diff. vram.rs:Pages::signal_now advances `value` only after a Signal is queued; `mark` and `mark_pending_recycles` cover unmarked mappings before before_execute or the reserved pool depend on them; and every non-test caller of vram::before_execute now handles the false return (title_textures.rs refresh_parts, submit_on, probe_gpu_content). Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Foniass commented 2026-12-01 13:45:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T13:45:46Z.


merge-check
base: b2b1f109d2
head: 69700342ee
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> did not finish: the lib test binary hung in this PR's own test hle::d3d12x::vram::tests::mappings_whose_signal_failed_get_a_later_mark_before_use, from about 2 min in, and three other vram tests (reservable_agrees_with_the_driver, superseded_texture_waits_for_every_title_queue, tracked_srv_global_cleanup_hooks_are_gated_and_exact, which pass on main) never finished either, most likely stuck behind it on the shared test lock. After 17 minutes I stopped the process; it couldn't exit, which is what a GPU queue stuck on a fence nothing signals looks like. No counts.
review: read the whole diff earlier on this head (my review comment has the details); the code findings there stand and none was blocking. What blocks is the test above. With FAIL_SIGNALS the native Signal is skipped, so a queue made to wait for that value waits for good unless the test opens it; on this machine (Windows, NVIDIA) nothing did. #3553's later commit added open_at_the_latest, a 10 s watchdog that opens such a test fence ("a test that holds a shared device's mapping queue can fail but never hang the test process"), to its copy of these tests; this head doesn't have it. With it, a test that goes wrong fails instead of taking the suite and the GPU process down.
performance: not measured (the run stopped at the hung test).
verdict: not yet: mappings_whose_signal_failed_get_a_later_mark_before_use hangs the lib test binary on Windows / NVIDIA, leaving a process that can't exit; bring #3553's open_at_the_latest watchdog (and VRAM_TEST_LOCK use) into this PR's tests, then rerun the suite on Windows
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7313134336 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7313134336). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T13:45:46Z. --- merge-check base: b2b1f109d27e746a62ec95b04dd1f9924452e682 head: 69700342ee0b67429a4dbdb771cffa5d708bfde6 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> did not finish: the lib test binary hung in this PR's own test `hle::d3d12x::vram::tests::mappings_whose_signal_failed_get_a_later_mark_before_use`, from about 2 min in, and three other `vram` tests (`reservable_agrees_with_the_driver`, `superseded_texture_waits_for_every_title_queue`, `tracked_srv_global_cleanup_hooks_are_gated_and_exact`, which pass on main) never finished either, most likely stuck behind it on the shared test lock. After 17 minutes I stopped the process; it couldn't exit, which is what a GPU queue stuck on a fence nothing signals looks like. No counts. review: read the whole diff earlier on this head (my review comment has the details); the code findings there stand and none was blocking. What blocks is the test above. With `FAIL_SIGNALS` the native Signal is skipped, so a queue made to wait for that value waits for good unless the test opens it; on this machine (Windows, NVIDIA) nothing did. #3553's later commit added `open_at_the_latest`, a 10 s watchdog that opens such a test fence ("a test that holds a shared device's mapping queue can fail but never hang the test process"), to its copy of these tests; this head doesn't have it. With it, a test that goes wrong fails instead of taking the suite and the GPU process down. performance: not measured (the run stopped at the hung test). verdict: not yet: `mappings_whose_signal_failed_get_a_later_mark_before_use` hangs the lib test binary on Windows / NVIDIA, leaving a process that can't exit; bring #3553's `open_at_the_latest` watchdog (and `VRAM_TEST_LOCK` use) into this PR's tests, then rerun the suite on Windows hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
bmjask commented 2026-12-01 20:01:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T20:01:46Z.

Code review location: crates/xcl/src/hle/d3d12x/title_textures.rs; line 2665

@@ -2660,7 +2662,9 @@ unsafe fn submit_on(dev: &ID3D12Device, queue: &ID3D12CommandQueue, items: &[tex
     // another thread after `refresh_once`'s wait, or its levels mapped just now by
     // `map_levels_with_texels`): a copy into a tile still unmapped is a copy-engine page fault
     // on NVIDIA (`DmaPageFaultWrite`).
-    super::vram::before_execute(queue);
+    if !super::vram::before_execute(queue) {

If before_execute fails inside submit_on here, the Err branch (~2919) treats it as an ordinary upload failure and queues a 100 ms retry. refresh_parts still returns Ready, so the title's ExecuteCommandLists go out against level tiles that map_levels_with_texels_in just mapped, with no Signal covering them and no queue Wait on them. That's the case the PR says should end the title with MappingUnmarked.

<!-- greyfinch-sync:ivall/xcl:review-comment:4760167839 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#discussion_r4760167839). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-01T20:01:46Z. **Code review location:** `crates/xcl/src/hle/d3d12x/title_textures.rs`; line 2665 ~~~~diff @@ -2660,7 +2662,9 @@ unsafe fn submit_on(dev: &ID3D12Device, queue: &ID3D12CommandQueue, items: &[tex // another thread after `refresh_once`'s wait, or its levels mapped just now by // `map_levels_with_texels`): a copy into a tile still unmapped is a copy-engine page fault // on NVIDIA (`DmaPageFaultWrite`). - super::vram::before_execute(queue); + if !super::vram::before_execute(queue) { ~~~~ --- If `before_execute` fails inside `submit_on` here, the Err branch (~2919) treats it as an ordinary upload failure and queues a 100 ms retry. `refresh_parts` still returns Ready, so the title's ExecuteCommandLists go out against level tiles that `map_levels_with_texels_in` just mapped, with no Signal covering them and no queue Wait on them. That's the case the PR says should end the title with `MappingUnmarked`.
bmjask commented 2026-12-01 20:01:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-12-01T20:01:46Z.

Review: COMMENTED


Review of 69700342: 2 finding(s). 1 are inline. These are on lines outside the diff:

crates/xcl/src/hle/d3d12x/vram.rs:2866: This is older code, but the same class of bug the PR fixes on the Signal side: reserve_page_wait sets waited[queue] = value before native_queue_wait, and that result is thrown away with let _. If the Wait fails (e.g. E_OUTOFMEMORY), every later before_execute on that queue sees waited >= value and skips the wait, so title work can run before mappings up to N are done.


These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.

<!-- greyfinch-sync:ivall/xcl:review:6139049855 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#pullrequestreview-6139049855). Originally posted by [bmjask](https://github.com/bmjask) on 2026-12-01T20:01:46Z. **Review:** COMMENTED --- Review of `69700342`: 2 finding(s). 1 are inline. These are on lines outside the diff: **`crates/xcl/src/hle/d3d12x/vram.rs:2866`**: This is older code, but the same class of bug the PR fixes on the Signal side: `reserve_page_wait` sets `waited[queue] = value` before `native_queue_wait`, and that result is thrown away with `let _`. If the Wait fails (e.g. E_OUTOFMEMORY), every later `before_execute` on that queue sees `waited >= value` and skips the wait, so title work can run before mappings up to N are done. --- _These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it._
Foniass commented 2026-12-01 20:32:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T20:32:08Z.


Test report (not a merge-check: PR description red: its smoke block is for an older head)
base: 6bfb5c5153
head: f5a574372a
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2906 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: follow-up on f5a57437 (rebased and amended from 69700342, the head of my merge-check above). Only test-side changes: a new Gate test guard in vram.rs (~5726-5794), reserved_resource_with_private_data_is_excluded_from_recycle now takes VRAM_TEST_LOCK (~5577), and a #[cfg(test)] RECYCLE_DRAIN_TEST_LOCK (~900) is taken in drain_recycled (~915) and around the test's park / recycle_ready / "no mark yet" step (~5925); the list_x.rs, real.rs, sparse.rs and title_textures.rs hunks and the runtime parts of vram.rs are the same as in 69700342. The hang blocker is fixed: all three gates are Gate locals, so unwinding drops them before _vram_guard is released; Drop signals the gate whenever open() hasn't finished, open() takes cancel only after its Signal succeeded, a failed queue Wait in Gate::new panics with the gate already built, and a panic inside with releases PAGES before the gates drop. Each watchdog holds only its own gate's fence and leaves when the sender drops, so it can't open the next test's gate; another test's work waiting behind a gate is limited by the 10 s watchdog, and the test then fails instead of hanging (the run below confirms it: the suite finished, and both of the PR's tests passed). RECYCLE_DRAIN_TEST_LOCK can't deadlock: drain_recycled takes it before PAGES, the test takes it before PARKING / PAGES, its two callers in late_release.rs (~306, ~363) hold no lock, and nothing reverses VRAM_TEST_LOCK -> drain lock. Earlier points: (1) still only FAIL_SIGNALS failures are tested; (2) still open: sparse::before_execute has no path returning MappingUnmarked, so the arm at list_x.rs ~3622 can't run; (3) resolved, #3553 is now on top of f5a57437. New, none blocking: (4) vram.rs ~5933: the test now calls mark_pending_recycles() itself while holding the lock, so the next drain_recycled() finds the recycle already marked and the retry inside drain_recycled (~918) is no longer tested; dropping the lock after the "no mark yet" assert and leaving the retry to drain_recycled would test it. (5) ~5687: the private-data test's SetEventOnCompletion(mark, NULL) blocks for good if item.mark is UNMARKED (u64::MAX, introduced here), which only happens after a real Signal failure. (6) ~5967: a panic in the gated test leaves its Pages in PAGES (only the last line removes it), so later tests can fail one after another, though they no longer hang. (7) The commit message has a doubled blank line before the new paragraph. Fine: the gate's ARMED / OPENED / RESCUED state machine and its ordering, the gate fence created on the original (unhooked) CreateFence slot, and git diff --check is clean.
performance: 60 s smoke of a retail title, main 6bfb5c51 vs this merge (01196f9a): 1646 -> 1672 frames shown (101 %; last presents per 2 s: 60 60 61), peak commit 18685 -> 18636 MB, 0 device removals, 0 crashes.
assessment: merges, builds and passes the whole suite on current main, and the test that hung on 69700342 now finishes and passes (mappings_whose_signal_failed_get_a_later_mark_before_use ... ok), so the blocker from my merge-check is gone; the smoke run is clean. What remains for a merge-check is the description's smoke block on this head (f5a57437); the new points (4)-(7) are not blocking
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7324852132 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7324852132). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T20:32:08Z. --- Test report (not a merge-check: `PR description` red: its smoke block is for an older head) base: 6bfb5c5153ccc23517daf30aa1071ddb0fadb53c head: f5a574372ae08ee44be993949c2a0eb9901471c3 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2906 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: follow-up on f5a57437 (rebased and amended from 69700342, the head of my merge-check above). Only test-side changes: a new `Gate` test guard in `vram.rs` (~5726-5794), `reserved_resource_with_private_data_is_excluded_from_recycle` now takes `VRAM_TEST_LOCK` (~5577), and a `#[cfg(test)]` `RECYCLE_DRAIN_TEST_LOCK` (~900) is taken in `drain_recycled` (~915) and around the test's park / `recycle_ready` / "no mark yet" step (~5925); the list_x.rs, real.rs, sparse.rs and title_textures.rs hunks and the runtime parts of `vram.rs` are the same as in 69700342. The hang blocker is fixed: all three gates are `Gate` locals, so unwinding drops them before `_vram_guard` is released; `Drop` signals the gate whenever `open()` hasn't finished, `open()` takes `cancel` only after its Signal succeeded, a failed queue Wait in `Gate::new` panics with the gate already built, and a panic inside `with` releases `PAGES` before the gates drop. Each watchdog holds only its own gate's fence and leaves when the sender drops, so it can't open the next test's gate; another test's work waiting behind a gate is limited by the 10 s watchdog, and the test then fails instead of hanging (the run below confirms it: the suite finished, and both of the PR's tests passed). `RECYCLE_DRAIN_TEST_LOCK` can't deadlock: `drain_recycled` takes it before `PAGES`, the test takes it before `PARKING` / `PAGES`, its two callers in `late_release.rs` (~306, ~363) hold no lock, and nothing reverses `VRAM_TEST_LOCK` -> drain lock. Earlier points: (1) still only `FAIL_SIGNALS` failures are tested; (2) still open: `sparse::before_execute` has no path returning `MappingUnmarked`, so the arm at `list_x.rs` ~3622 can't run; (3) resolved, #3553 is now on top of f5a57437. New, none blocking: (4) `vram.rs` ~5933: the test now calls `mark_pending_recycles()` itself while holding the lock, so the next `drain_recycled()` finds the recycle already marked and the retry inside `drain_recycled` (~918) is no longer tested; dropping the lock after the "no mark yet" assert and leaving the retry to `drain_recycled` would test it. (5) ~5687: the private-data test's `SetEventOnCompletion(mark, NULL)` blocks for good if `item.mark` is `UNMARKED` (`u64::MAX`, introduced here), which only happens after a real Signal failure. (6) ~5967: a panic in the gated test leaves its `Pages` in `PAGES` (only the last line removes it), so later tests can fail one after another, though they no longer hang. (7) The commit message has a doubled blank line before the new paragraph. Fine: the gate's `ARMED` / `OPENED` / `RESCUED` state machine and its ordering, the gate fence created on the original (unhooked) `CreateFence` slot, and `git diff --check` is clean. performance: 60 s smoke of a retail title, main 6bfb5c51 vs this merge (01196f9a): 1646 -> 1672 frames shown (101 %; last presents per 2 s: 60 60 61), peak commit 18685 -> 18636 MB, 0 device removals, 0 crashes. assessment: merges, builds and passes the whole suite on current main, and the test that hung on 69700342 now finishes and passes (`mappings_whose_signal_failed_get_a_later_mark_before_use ... ok`), so the blocker from my merge-check is gone; the smoke run is clean. What remains for a merge-check is the description's smoke block on this head (f5a57437); the new points (4)-(7) are not blocking hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
Foniass commented 2026-12-01 22:28:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T22:28:22Z.


merge-check
base: f07e426dad
head: 94b0d76108
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2906 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: follow-up on 94b0d761 (+84/-35 since f5a57437, the head of my test report above). The commit closes two gaps f5a57437 left. A failed consumer Wait was still ignored (already so on main: let _ = native_queue_wait), and reserve_page_wait recorded the queue as having waited before the Wait was queued, so after a failed Wait every later submit skipped it and could read tiles that weren't mapped; now vram::before_execute (vram.rs ~2866) queues the Wait under the consumer queue's queue_submit lease, records waited only after it succeeds, and returns false when it fails. And submit_on's before_execute failure, only a warning with a retry before, now becomes UploadError::MappingUnmarked (title_textures.rs ~2677 / ~2932), passed up through upload_all and refresh_parts so prepare_title_submission stops the title; under XCL_TEXTURE_LEVEL_PAGES=1 there's one more before_execute after lazy levels are mapped (~2943). On the hang class: the only Wait value is still pages.mark() on pages.fence, which f5a57437 limits to values whose Signal was queued, so nothing waits for a value nobody signals. Lock order: per-queue serial -> lease(Q) was already there through native_queue_wait, and the new step only adds lease(Q) -> PAGES; PAGES is held across a queue call only in signal_now on the mapping queue, never a before_execute queue, so no deadlock with the tile-mapping queue was found. Default-path cost: two extra PAGES lock acquisitions on submits that need a mapping Wait, no new CPU or GPU wait. Findings: (a) the title_textures propagation has no test: the changed vram test (~5881, FAIL_MAPPING_WAIT) fails without the vram half, but nothing drives submit_on -> upload_all -> refresh_parts to MappingUnmarked, or the lazy-level recheck. (b) The test's "the next submission retries the Wait" step can't happen at run time, since a false from before_execute stops the title; it only checks the waited cache, so it shouldn't be presented as a retry. (c) On the own-upload-queue branch (title compute / copy queue, ~2900), a failed Signal or Wait puts the textures on RETRY and then stops the title anyway, so that RETRY push is dead there. (d) The already_waited recheck inside the lease (~2870) and its comment about a racing submit describe a race that can't happen, since before_execute holds the queue's serial lock throughout (harmless). (e) Scope: the Wait half fixes a bug main already had, not a failed Signal; it's small and the same class, so acceptable as its own commit, but the subject doesn't say a failed Wait now stops the title. Earlier points: (1) now one injected Wait failure is tested too, still no real driver failure; (2) unchanged, the arm at list_x.rs ~3622 is still dead; (4)-(6) unchanged. Fine: no new wait on a value nothing signals, no lock-order cycle, the description covers the change, and its smoke block names this head.
performance: 60 s smoke of a retail title, main f07e426d vs this merge (4a4d8f5f): 1672 -> 1653 frames shown (98 %; last presents per 2 s: 60 60 61), peak commit 17352 -> 18273 MB, 0 device removals, 0 crashes. The suite counts are from the first run of this merge (same head and base), whose smoke run hit a smoke-script startup error unrelated to the PR (the same build ran the title normally by hand); the smoke above is from the second run, whose lib test binary was lost to this machine's known intermittent uma_driver coherent-window abort.
verdict: safe to merge: the hang is gone (both of the PR's tests pass, the suite finishes), the new commit adds no wait on a value nothing signals and no lock-order cycle, and the smoke run is clean; the open points (tests for the title_textures propagation, the dead RETRY push and list_x.rs arm, wording) don't block
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7327903536 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7327903536). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T22:28:22Z. --- merge-check base: f07e426dade72aa7112cf6bfe08ca6f6ff5a9d5c head: 94b0d76108c326118783374a8a1fc7e5568a4129 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2906 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: follow-up on 94b0d761 (+84/-35 since f5a57437, the head of my test report above). The commit closes two gaps f5a57437 left. A failed consumer Wait was still ignored (already so on main: `let _ = native_queue_wait`), and `reserve_page_wait` recorded the queue as having waited before the Wait was queued, so after a failed Wait every later submit skipped it and could read tiles that weren't mapped; now `vram::before_execute` (`vram.rs` ~2866) queues the Wait under the consumer queue's `queue_submit` lease, records `waited` only after it succeeds, and returns false when it fails. And `submit_on`'s `before_execute` failure, only a warning with a retry before, now becomes `UploadError::MappingUnmarked` (`title_textures.rs` ~2677 / ~2932), passed up through `upload_all` and `refresh_parts` so `prepare_title_submission` stops the title; under `XCL_TEXTURE_LEVEL_PAGES=1` there's one more `before_execute` after lazy levels are mapped (~2943). On the hang class: the only Wait value is still `pages.mark()` on `pages.fence`, which f5a57437 limits to values whose Signal was queued, so nothing waits for a value nobody signals. Lock order: per-queue `serial` -> lease(Q) was already there through `native_queue_wait`, and the new step only adds lease(Q) -> `PAGES`; `PAGES` is held across a queue call only in `signal_now` on the mapping queue, never a `before_execute` queue, so no deadlock with the tile-mapping queue was found. Default-path cost: two extra `PAGES` lock acquisitions on submits that need a mapping Wait, no new CPU or GPU wait. Findings: (a) the `title_textures` propagation has no test: the changed vram test (~5881, `FAIL_MAPPING_WAIT`) fails without the vram half, but nothing drives `submit_on` -> `upload_all` -> `refresh_parts` to `MappingUnmarked`, or the lazy-level recheck. (b) The test's "the next submission retries the Wait" step can't happen at run time, since a false from `before_execute` stops the title; it only checks the `waited` cache, so it shouldn't be presented as a retry. (c) On the own-upload-queue branch (title compute / copy queue, ~2900), a failed Signal or Wait puts the textures on `RETRY` and then stops the title anyway, so that `RETRY` push is dead there. (d) The `already_waited` recheck inside the lease (~2870) and its comment about a racing submit describe a race that can't happen, since `before_execute` holds the queue's `serial` lock throughout (harmless). (e) Scope: the Wait half fixes a bug main already had, not a failed Signal; it's small and the same class, so acceptable as its own commit, but the subject doesn't say a failed Wait now stops the title. Earlier points: (1) now one injected Wait failure is tested too, still no real driver failure; (2) unchanged, the arm at `list_x.rs` ~3622 is still dead; (4)-(6) unchanged. Fine: no new wait on a value nothing signals, no lock-order cycle, the description covers the change, and its smoke block names this head. performance: 60 s smoke of a retail title, main f07e426d vs this merge (4a4d8f5f): 1672 -> 1653 frames shown (98 %; last presents per 2 s: 60 60 61), peak commit 17352 -> 18273 MB, 0 device removals, 0 crashes. The suite counts are from the first run of this merge (same head and base), whose smoke run hit a smoke-script startup error unrelated to the PR (the same build ran the title normally by hand); the smoke above is from the second run, whose lib test binary was lost to this machine's known intermittent `uma_driver` coherent-window abort. verdict: safe to merge: the hang is gone (both of the PR's tests pass, the suite finishes), the new commit adds no wait on a value nothing signals and no lock-order cycle, and the smoke run is clean; the open points (tests for the `title_textures` propagation, the dead `RETRY` push and `list_x.rs` arm, wording) don't block hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
Decodere commented 2026-12-02 08:46:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T08:46:51Z.


merge-check
base: 1c8b551475
head: 94b0d76108
merge: clean trial merge into 1c8b551475e1e7bfe48f94448492a4c3544a2e0f (trial-merge commit e06129ff9149e71b6591e9b5c770906adfc9a358; git diff --check clean).
build: cargo build --workspace -> ok; cargo build --release -p xcl -> ok.
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture (43 targets) -> 2911 passed, 0 failed, 51 ignored (+2 new tests vs main 1c8b5514; all 43 targets green including gpu_two_pass_cache_e2e). All new and updated hle::d3d12x::vram::tests passed with 0 skips on RTX 4060: a_failed_signal_leaves_the_value_a_signal_reached, mappings_whose_signal_failed_get_a_later_mark_before_use, title_queue_mapping_wait_reservation_is_monotonic_and_per_queue, and reserved_resource_with_private_data_is_excluded_from_recycle. 28 SKIPPED lines — all hardware/environment-expected on RTX 4060 (22 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 2 no heap windows, 1 cannot disable the driver cache (Windows Developer Mode required)).
review: read the full merged diff (5 files: crates/xcl/src/hle/d3d12x/list_x.rs, real.rs, sparse.rs, title_textures.rs, vram.rs, +440/-42). Scope is clean and well-synchronized: Pages::signal_now only advances self.value and clears self.unmarked when native_queue_signal succeeds, Pages::mark retries signaling if any mapping remained unmarked, and before_execute serializes the consumer queue's native_queue_wait and monotonic pages.waited update inside queue_submit::with(queue_key, ...) (re-checking already_waited under PAGES lock so a failed Wait is never cached and racing submits cannot regress waited). PreparationOutcome::MappingUnmarked propagates cleanly through title_textures.rs (refresh_parts, upload_all including post-lazy-level preparation, submit_on, probe_gpu_content) to stop unsafe title submissions (list_x.rs, real.rs), and PendingRecycle uses UNMARKED with retry in drain_recycled so un-signaled retired textures never re-enter reserved_pool. The new GPU tests properly serialize under VRAM_TEST_LOCK / RECYCLE_DRAIN_TEST_LOCK and guard the mapping queue gate with an unwind/watchdog Drop. No UB, lock-ordering, or correctness issues found.
performance: Tier 2 60 s retail smoke (title: 29640639) shows no regression vs main 1c8b5514 baseline (1462 frames, presents per 2 s (last 3): 48 53 59, peak commit: 16043 MB): 1626 frames (+11.2%), presents per 2 s (last 3): 60 60 60, peak commit: 14830 MB (-7.6%), 0 device removals, 0 crashes.

xcl-smoke v1
commit: e06129ff9149e71b6591e9b5c770906adfc9a358
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1626 (PresentX 1626)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14830 MB

verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7339917212 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7339917212). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T08:46:51Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 94b0d76108c326118783374a8a1fc7e5568a4129 merge: clean trial merge into `1c8b551475e1e7bfe48f94448492a4c3544a2e0f` (trial-merge commit `e06129ff9149e71b6591e9b5c770906adfc9a358`; `git diff --check` clean). build: `cargo build --workspace` -> ok; `cargo build --release -p xcl` -> ok. tests: `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture` (43 targets) -> 2911 passed, 0 failed, 51 ignored (+2 new tests vs `main` `1c8b5514`; all 43 targets green including `gpu_two_pass_cache_e2e`). All new and updated `hle::d3d12x::vram::tests` passed with 0 skips on RTX 4060: `a_failed_signal_leaves_the_value_a_signal_reached`, `mappings_whose_signal_failed_get_a_later_mark_before_use`, `title_queue_mapping_wait_reservation_is_monotonic_and_per_queue`, and `reserved_resource_with_private_data_is_excluded_from_recycle`. 28 `SKIPPED` lines — all hardware/environment-expected on RTX 4060 (22 `no wave64`, 2 `no d3d12SDKLayers.dll`, 1 `no D3D12 debug layer`, 2 `no heap windows`, 1 `cannot disable the driver cache (Windows Developer Mode required)`). review: read the full merged diff (5 files: `crates/xcl/src/hle/d3d12x/list_x.rs`, `real.rs`, `sparse.rs`, `title_textures.rs`, `vram.rs`, +440/-42). Scope is clean and well-synchronized: `Pages::signal_now` only advances `self.value` and clears `self.unmarked` when `native_queue_signal` succeeds, `Pages::mark` retries signaling if any mapping remained unmarked, and `before_execute` serializes the consumer queue's `native_queue_wait` and monotonic `pages.waited` update inside `queue_submit::with(queue_key, ...)` (re-checking `already_waited` under `PAGES` lock so a failed Wait is never cached and racing submits cannot regress `waited`). `PreparationOutcome::MappingUnmarked` propagates cleanly through `title_textures.rs` (`refresh_parts`, `upload_all` including post-lazy-level preparation, `submit_on`, `probe_gpu_content`) to stop unsafe title submissions (`list_x.rs`, `real.rs`), and `PendingRecycle` uses `UNMARKED` with retry in `drain_recycled` so un-signaled retired textures never re-enter `reserved_pool`. The new GPU tests properly serialize under `VRAM_TEST_LOCK` / `RECYCLE_DRAIN_TEST_LOCK` and guard the mapping queue gate with an unwind/watchdog `Drop`. No UB, lock-ordering, or correctness issues found. performance: Tier 2 60 s retail smoke (`title: 29640639`) shows no regression vs `main` `1c8b5514` baseline (`1462` frames, `presents per 2 s (last 3): 48 53 59`, `peak commit: 16043 MB`): `1626` frames (+11.2%), `presents per 2 s (last 3): 60 60 60`, `peak commit: 14830 MB` (-7.6%), 0 device removals, 0 crashes. ``` xcl-smoke v1 commit: e06129ff9149e71b6591e9b5c770906adfc9a358 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1626 (PresentX 1626) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14830 MB ``` verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
lucsoft commented 2026-12-02 10:32:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-02T10:32:15Z.


@throny looks like the tag "needs-pr-check" is stale. ci is passing. i have two tests. i think this is mergable 🚀 same with 3553

<!-- greyfinch-sync:ivall/xcl:comment:7342614665 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7342614665). Originally posted by [lucsoft](https://github.com/lucsoft) on 2026-12-02T10:32:15Z. --- @throny looks like the tag "needs-pr-check" is stale. ci is passing. i have two tests. i think this is mergable :rocket: same with 3553
throny commented 2026-12-02 10:38:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-02T10:38:29Z.


@lucsoft you're right: the latest PR description run is green, the needs-pr-check label was left from the earlier red one; removed. Two safe merge checks on this head (Foniass, Decodere). Running the trial suite on current main now; if it's clean I'll merge, and #3553 (stacked on it) can then get its second check.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7342767202 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7342767202). Originally posted by [throny](https://github.com/throny) on 2026-12-02T10:38:29Z. --- @lucsoft you're right: the latest `PR description` run is green, the `needs-pr-check` label was left from the earlier red one; removed. Two safe merge checks on this head (Foniass, Decodere). Running the trial suite on current `main` now; if it's clean I'll merge, and #3553 (stacked on it) can then get its second check. AI use: Claude Code (Claude Opus 5.5).
throny commented 2026-12-02 10:44:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-02T10:44:54Z.


@lucsoft the trial on current main 1c8b5514 is clean (2911 passed, 0 failed, 51 ignored, RTX 4080), but GitHub blocks the merge for one reason only: the branch rule needs every review conversation resolved, and @bmjask's thread on title_textures.rs:2677 (a failed before_execute inside submit_on being treated as an ordinary upload failure while refresh_parts still returns Ready) has no answer yet. Once that is answered or fixed and resolved, I'll merge at the checked head.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7342922432 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#issuecomment-7342922432). Originally posted by [throny](https://github.com/throny) on 2026-12-02T10:44:54Z. --- @lucsoft the trial on current `main` `1c8b5514` is clean (2911 passed, 0 failed, 51 ignored, RTX 4080), but GitHub blocks the merge for one reason only: the branch rule needs every review conversation resolved, and @bmjask's thread on `title_textures.rs:2677` (a failed `before_execute` inside `submit_on` being treated as an ordinary upload failure while `refresh_parts` still returns Ready) has no answer yet. Once that is answered or fixed and resolved, I'll merge at the checked head. AI use: Claude Code (Claude Opus 5.5).
lucsoft commented 2026-12-02 10:47:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-02T10:47:53Z.

Code review location: crates/xcl/src/hle/d3d12x/title_textures.rs; line 2665

@@ -2660,7 +2662,9 @@ unsafe fn submit_on(dev: &ID3D12Device, queue: &ID3D12CommandQueue, items: &[tex
     // another thread after `refresh_once`'s wait, or its levels mapped just now by
     // `map_levels_with_texels`): a copy into a tile still unmapped is a copy-engine page fault
     // on NVIDIA (`DmaPageFaultWrite`).
-    super::vram::before_execute(queue);
+    if !super::vram::before_execute(queue) {

@throny This is fixed in the tested head 94b0d761. When before_execute fails inside submit_on, it returns UploadError::MappingUnmarked. That propagates through refresh_parts as PreparationOutcome::MappingUnmarked and stops the title submission before ExecuteCommandLists.

<!-- greyfinch-sync:ivall/xcl:review-comment:4768359306 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3566#discussion_r4768359306). Originally posted by [lucsoft](https://github.com/lucsoft) on 2026-12-02T10:47:53Z. **Code review location:** `crates/xcl/src/hle/d3d12x/title_textures.rs`; line 2665 ~~~~diff @@ -2660,7 +2662,9 @@ unsafe fn submit_on(dev: &ID3D12Device, queue: &ID3D12CommandQueue, items: &[tex // another thread after `refresh_once`'s wait, or its levels mapped just now by // `map_levels_with_texels`): a copy into a tile still unmapped is a copy-engine page fault // on NVIDIA (`DmaPageFaultWrite`). - super::vram::before_execute(queue); + if !super::vram::before_execute(queue) { ~~~~ --- @throny This is fixed in the tested head `94b0d761`. When `before_execute` fails inside `submit_on`, it returns `UploadError::MappingUnmarked`. That propagates through `refresh_parts` as `PreparationOutcome::MappingUnmarked` and stops the title submission before `ExecuteCommandLists`.
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
xcl-dev/xcl!3566
No description provided.