D3D12.X: fail lazy texture placement when mappings are unfinished #3124
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3124"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T11:51:45Z.
Alternative follow-up to throny's #3116, preserving its explicit NULL mapping workaround and attribution. This branch targets
nvidia-devdirectly; it is not stacked on #3116. The original PR can still return a new lazy texture after Signal failure, a wait timeout, or the fence's device-removal sentinel. This adaptation returns an allocation error in those cases instead of publishing an unfinished resource.Rebased onto main (2026-11-28).
nvidia-devwas merged intomainby #3203, so this PR now targetsmainand its branch was rebased ontomain765b2c5bfff6754e8c9886a73e188a86aca3c64c: head3caa566dedf4c07a7cf96dc50eec54698ec10399(wasb5bca33d72f36f80a5f9edf14512e05e0fd25d19). Conflicts were invram.rs:place_on_pagesnow also keepsmain's texel accounting, andbefore_executekeepsmain's wait measurement next to the settled-texture release. On the rebased head, on the same RTX 3060 Ti PC, debug profile:cargo check -p xcl --all-targetsexited 0, andcargo test -p xcl --lib -- --test-threads=4 failed_new_mapping_keeps_resource_until_a_real_completion new_mapping_wait_requires_completion_and_propagates_failures a_placed_texture_gets_the_pages_of_a_level_with_its_texelsgave 3 passed, 0 failed, 0 ignored, no SKIPPED. The whole suite and the paired title runs have not been rerun on this head; every other result below is from the earlier head. The rebase and its conflict resolution were done with Claude Code.What is in it
Tested
b5bca33d72f36f80a5f9edf14512e05e0fd25d19.d54d80e1bc9d070cbec4a619abb5f4b89880b2f5compiled withcargo build --locked --release -p xcl --target-dir <isolated-target>: exit 0, 229.200 seconds. This is compilation of the combined candidate, not a build or runtime validation of this standalone PR. Zero tests executed; no GPU checks or smoke run.git diff --checkonly. The NVIDIA-only port has the same added/removed lines as the independently reviewed local adaptation; it contains one commit over54225f5884a94cd23b7aab3f703a7c975070aa77.Regression run
Not tested
AI use
Optional contributor/test coordination: https://discord.gg/6B4TykyC4W
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T12:06:46Z.
Failed interactive integration result for
d54d80e1bc9d070cbec4a619abb5f4b89880b2f5, containing this PR's change together with the other memory/removal repairs. This was not a standalone test ofb5bca33d72f36f80a5f9edf14512e05e0fd25d19and does not establish which change caused or prevented a symptom.0x887a0005(DEVICE_REMOVED); no external stop or automated inputs.0x887a0004(unsupported), so there is no reliable GPU fault location. System commit still had 34,764 MiB headroom at removal; no out-of-memory result was established.The combined run still removed the device. No initial-texture-mapping failure was logged. This does not identify a failing mapping or show that the reported workaround is ineffective; the failing GPU operation is unavailable.
This run does not justify merge approval or a claim that RAM growth/device removal is fixed. Full standalone validation and matching main/head smoke reports remain outstanding. No builds or synthetic GPU tests ran during gameplay. Logs, hashes, counter samples and source/installed-data preservation checks are retained locally.
AI use: OpenAI Codex (GPT-6) launched the prepared candidate at the user's request, monitored existing logs and read-only counters, and prepared this report; a separate Codex agent reviewed the log evidence.
Optional contributor/test coordination: https://discord.gg/gK3y7WRRY
Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-28T13:12:03Z.
Test report for head
b5bca33d. No new failure.new_mapping_wait_requires_completion_and_propagates_failures,failed_new_mapping_keeps_resource_until_a_real_completion. The extended native fixturetitle_textures::tests::a_placed_texture_gets_the_pages_of_a_level_with_its_texelsalso passes, with no skip.Tested: NVIDIA GeForce RTX 3070 8 GB (driver 617.42, wave32), Intel i9-9900K, 32 GB RAM, Windows 11 Pro N 26200, rustc 1.99.0, DXC 1.8.2502.11, debug. Each head was tested alone, with its own target directory, on its base
nvidia-dev54225f58. The library tests were run ascargo test -p xcl --lib --no-fail-fast -- --test-threads=4 --skip a_refused_gpu_upload_segment_becomes_custom. That one test is left out because the library test binary stops at its fail-stop (0x7C10003), as throny reported on #3041, with or without this PR; alone it passes. On the base the same command gives 1771 passed, 6 failed, 28 ignored. The 6 failures (placed_title_textures_share_vram_and_preserve_pixels, threestream_recheck_*,d32s8_targets_take_their_own_size_of_video_memory,gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark) are the base's own and are not repeated below.I also merged the four heads #3122–#3125 together on
54225f58(only README.md conflicts, plus the two new tests of #3123 and #3125 at the same place insparse.rs; both kept). On that treecargo test --workspace --no-fail-fast -- --test-threads=4gives: library binary stopped at the same fail-stop; the other test binaries 132 passed, 0 failed, 20 ignored. The library command above: 1779 passed, 9 failed, 28 ignored, that is the base's 6 plus the 3 named below.Not tested: a title run or smoke run of this head, a release build, AMD and Intel GPUs.
AI use: Claude Code (Claude Opus 5.5) ran the merges, builds and tests, and wrote this report.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-28T15:05:48Z.
@Prime1997 the whole suite of your head on an RTX 3090 against its base on the same machine: no failure the base doesn't have; its new tests pass:
vram::tests::failed_new_mapping_keeps_resource_until_a_real_completion,vram::tests::new_mapping_wait_requires_completion_and_propagates_failures.Tested:
b5bca33dand its basenvidia-dev54225f58.XCL_*set.cargo test --workspace --no-fail-fast -- --test-threads=4 --skip uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment --skip uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window(those three end the lib test binary on 621.24, at the base too)title_textures: one0x8007000Ein the full run, passes alone, and threePoisonErrorfrom it; 2vram0x8007000E;e2etest_title_runs_and_game_folder_is_untouched).Not tested: a title run; a release build; AMD / Intel.
AI use: an agent swarm: Claude Fable 5.2, Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T15:18:02Z.
In-title check of head
b5bca33donnvidia-dev54225f58: 10 of 10 world entries clean, no device removal, no placement failed.Tested
54225f58+ this PR's diff (README part left out) + the three local patches all my world runs carry (#684, the input-timing patch, the shader-preparation skip). Same setup as the entries for #3116:XCL_TEXTURE_LEVEL_PAGES=1, 16 view windows,XCL_UMA_DRIVER=mixed:1536:1792, 360 s per run, automatic input into the world.new texture mapping did not completeappeared 0 times in the 10 logs, so the new failure path (timeout, failed signal, removed device) never ran here. With #3116 the 250 ms cap was hit once in 10 runs; with this PR's 5 s deadline nothing was hit.Not tested
AI use: Claude Code (Claude Fable 5.2) built the tree, made the runs and wrote this.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-28T20:49:37Z.
One thing from building a local test branch of main with your open PRs on it (head
3caa566d):crates/xcl/src/hle/d3d12x/vram.rs:1904, innull_all, signals withself.queue.Signal(&self.fence, value). Every other signal on this queue in the same file goes throughsuper::real::native_queue_signal(vram.rs:1777, 1808, 2290, 2667). Its doc comment inreal.rsgives the reason: console queue layouts remap public slots 14 and up, so a COM call on an adopted queue may not reach the nativeSignal, and the helper also takes the queue's submit lease.Suggested change:
Not tested on its own: with that one line changed the branch builds and the vram lib tests pass (41), no title run yet.
AI use: found by Claude Code (Claude Opus 5.5) while merging the PR onto main; checked by reading with Claude Fable 5.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-29T03:23:10Z.
Current-head build blocker on #3124 at
75cb5fcbe212f9e0f3bd86c89b03379d4ffbadbf:vram.rs::place_on_pagescontains both the new tuple-returning branch and an old copy of the branch after it. On mainfa204595a488c60c6c5f905244f0172072c9c2a9, the unmodified head failscargo test -p xcl --lib new_mapping_wait_requires_completion_and_propagates_failuresbefore tests run: unexpectedpagesafter(true, None), two missingTarget.recyclefields, incompatiblebool/tuple branches, and the old one-argumentforget_pagescall. This explains the red Windows build check.I tested the correction below in an uncommitted local copy of that exact head. It preserves main's
recycle_key, removes the duplicated branch, and passesfalsetoforget_pagesbecause the failed placement is unpublished and its resource is held separately inunsettled. It also applies Kalmarv's existingnative_queue_signalfinding; that call must use the native queue slot and submit lease.Candidate diff against PR head
Tested: Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D. On the candidate,
cargo build --workspacepassed;cargo test -p xcl --lib new_mapping -- --test-threads=1passed 2/2;cargo test -p xcl --lib a_placed_texture_gets_the_pages_of_a_level_with_its_texels -- --test-threads=1passed 1/1 on the GPU with no skip.cargo test --workspace --no-fail-fast -- --test-threads=4ran: library 2,470 passed, 1 failed, 29 ignored, with 26 printedSKIPPEDnotices;gpu_two_pass_cache_e2efailed, and the other targets passed. Both named failures (console_mesh_caches_hlsl_compute_pass_in_memory_and_on_diskandtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs) also reproduce in focused runs on untouched main, so they are not established regressions from this candidate.Not tested: a clean-head paired title smoke, a forced signal failure, AMD/Intel, and Wine. The PR-description check still needs generated smoke blocks after the author pushes the fix. This local candidate is a build/test aid, not a merge-ready verdict.
AI use: Codex (GPT-6.2 Sol) reviewed the current head, wrote the local correction, and ran the tests.
Imported from ivall/xcl. Originally posted by throny on 2026-11-29T03:30:50Z.
merge-check claim
head:
75cb5fcbe2Re-check of the head rebased onto main.
Imported from ivall/xcl. Originally posted by throny on 2026-11-29T03:41:37Z.
merge-check
base:
fa204595head:
75cb5fcbe2merge: clean
build: cargo build --workspace -> cargo build --workspace on the merge result with main
fa204595-> FAILED, 4 errors in crates/xcl/src/hle/d3d12x/vram.rs: 2 x E0063 missing fieldrecyclein an initializer ofvram::Target, E0308 "ifandelsehave incompatible types", E0061 "this function takes 2 arguments but 1 argument was supplied". The PR's own CI on this head is red with the same errors.tests: none: the merge result does not build.
review: re-check of the head rebased onto main. The PR's own lines differ from the head I ran in the title only where the rebase had to follow main (the two inserts of a target now carry the
texelsfield). What breaks is the other side of the same rebase: main has since givenTargetarecyclefield and changed two things next to the lines this PR rewrites, and the rebased code was not brought along. The logic of the fix is unchanged and still the one that gave 10 of 10 clean world entries here.performance: nothing new.
verdict: not yet: it does not build on current main (rebase onto main again and add
recycleto the two initializers, and follow the changed signature); I re-check and re-run the world entries on the new head at once, since everyone needs this fix to reach the world.hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by throny on 2026-11-29T10:24:31Z.
To get this unblocked: I ported the change of this PR (from its earlier head
b5bca33d, the one with the 10 clean world entries) onto currentmaind8bd9a38locally, and it builds and runs. What it needed, in case it helps the rebase here:vram.rsplace_on_pages, the failure path's call becomesforget_pages(raw as usize, false): onmainthat function now takes(resource, held). I passedfalsebecause the placement was never published, so it should not feed the recycle pool; that choice is a judgement, not tested on its own.Targetinitializers stay asmainhas them, withrecycle: recycle_key; only their results are wrapped in this PR's tuple. With that there is no missing-field error and noif/elsetype mismatch.Tested on that port (RTX 4080 16 GB, 621.40;
maind8bd9a38+ this change + a local input-timing patch):cargo build --release -p xcl: ok.cargo test --release -p xcl --lib vram -- --test-threads=4: 74 passed, 0 failed, 1 ignored (the two tests of this PR among them).Not tested: the whole suite on the port, and more than two world entries. As soon as the head here builds, I run the merge check and ten world entries on it. If it is easier, I can also put the ported diff in a comment.
AI use: Claude Code; Claude Sonnet 5.5 made the port and ran the tests, Claude Fable 5.2 made the world runs and wrote this.
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T22:44:16Z.
Review: COMMENTED
Critical review of current head
75cb5fcb. Build blocker: the rebasedvram.rs::place_on_pagescontains the new tuple-returning branch followed by an old copy of that branch, causing incompatible branch types and staleTarget/forget_pagescalls against current main. This was reproduced in the current-head build report. Please remove the duplicated old path, port the new path to main'srecyclefield and two-argumentforget_pages, then reruncargo check --all-targetsand the failed-mapping GPU fixture. The failure policy itself is sensible, but this head is not mergeable as working code. No local Windows run.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:28:38Z.
Review (head
75cb5fcb, diff read, not a merge-check:Build and testandPR descriptionboth fail, so not built or run here):recycle: recycle_key/truebranches in the same if/else chain (vram.rs~2456-2480), andforget_pages(raw as usize)(~2492) is missing main's newheldargument. Please rebase rather than merge main in.return Some(error)(~2496) becomesplaced_hratdevice_x.rs~1298, which skips the fallback to a committed resource, so the title gets a failed CreatePlacedResourceX with a nullppvand will likely crash (the same problem as #3276). Keeping the texture inunsettledand returningNone, as the!boundpath does, would fall back instead.null_allcallsself.queue.Signalwhile holdingPAGES(~2137), while every other Signal on this queue goes throughnative_queue_signal(~1939, ~1970), which also takes the submit lease.PR descriptionfails: no xcl-smoke blocks, and the stated head (3caa566d) isn't the real one. AI use gives no model for the Claude Code rebase.Fine: nothing changes by default (
XCL_TEXTURE_LEVEL_PAGESis off), the wait happens without holdingPAGES, the unpublished texture is kept until its mapping really completes, and the helper tests and extended GPU test look right.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T16:55:37Z.
Test report (not a merge-check:
PR descriptionred)base:
b2b1f109d2head:
75cb5fcbe2merge: clean (no textual conflict)
build: cargo build --workspace -> failed: the merge doesn't compile. In
crates/xcl/src/hle/d3d12x/vram.rs~2570-2584 the PR'spages.targets.insert(raw as usize, Target { va, console_bytes, total, mapped: true, ... })lacks therecyclefieldvram::Targethas on main now (E0063, twice), a;is missing after(true, None)(~2575), and theif/elsearms no longer have the same type (E0308, ~2584). The code around it changed on main since this PR's base, so it needs a rebase rather than a merge.tests: not run (no build).
review: not repeated here; my review of this same head is at https://github.com/xcl-dev/xcl/pull/3124#issuecomment-7301810141, and its findings stand. This run adds what reading couldn't: whether the change merges, builds and passes the whole suite on current main.
performance: not measured.
assessment: needs a rebase onto current main; the findings in my review stand
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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.