Twin copies take the host copy's own level: no CopyTextureRegion past a held copy's edge (0x80070057 at list close) #3792
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3792
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3792"
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?
@Mikey970 on GitHub · 2026-11-30 07:18 UTC · original
Mikey970:pr/twin-levels→main· +184 −6 · 4 files · 2 commits · closed without merging[pr-fix] Placed twins: copies take the twin's host level, not the title's index (0x80070057)
Fixes #2914 (its second case: "the destination region extends past ... only has 128 width")
What it changes
The copies into views placed over a texture the host copied into (
resource::placed_twins,VICTORY_PLACED_COPIED, both twin loops inlist.rs) wrote into the twin's host copy at thetitle's subresource index. A twin's host copy can begin at a later level (held levels,
VICTORY_HELD_LEVELS, on by default). Once the host has written the twin,want_levelleaves the copyas it is. That happens when
texture::seed_latermarks it attexture_at, or after an earlier copy.seed_pending's ownwant_level(view, 0)returns early for such a twin, and the twin loops callwant_levelonly for twins that have not been written yet. So when a slot's mirror makes the view's hostcopy at the viewed level before
seed_pendingruns, the copy keeps that base. A bake's copy into level 0of a 1024x1024 BC7 texture then went into the twin's 128x128 level 0. D3D12 refuses that copy and the
host list does not close:
resource::host_targetmaps title level L to host level L − base of the same slice(
host_subresource). It also checks that the host level is as large as the title's (same_extent).A level the copy does not hold gets no copy. Such copies are counted, and the first 16 are logged
(
twin_copy_left_out): "a copy into a view placed over a texture the host copied into is left out".CopyResourceinto a twin is made only when both host textures are laid out alike.seed_pendingoffsets the source level by the bases of both copies. Before, it compared footprintsand refused the seed instead of crashing.
No switch: it only redirects copies to the right level, or leaves out ones D3D12 refuses.
How it was tested
Mikey970/VIctory-NVIDIA, which carries a port ofe530c003plus small host copies that also begin past level 0): RTX 4080 16 GB, Series X, 1080p. Every run died
about 107 s into the world with
a host command list did not close (0x80070057). The D3D12 debug layernamed the copy above (run R48-debug). The build before the
e530c003port ran the full route repeatedly.Our fix commit is the same change as this one.
main(41adb551+ this change, together with #3749 and #3750), RTX 4080, Series X profile, DLSS Performance via Streamline, 375 s Chapter 1 route: the route completed with noa host command list did not closeerror. Without this change, 3 of 5 of our runs ofmain-based builds that reached the shore ended there witha host command list did not close (0x80070057), and a diagnostics build withVICTORY_D3D12_DEBUG=1named it:ID3D12CommandList::CopyTextureRegion: The destination region extends past … the destination format is BC7_TYPELESS, the source format is R32G32B32A32_TYPELESS … the operation requires the destination subresource to have 1024 width, 1024 height … But the destination subresource only has 128 width, 128 height. On our fork, where held-level and small host copies are more common, the same error ended every run about 107 s into the world until this change; with it the full route completed (34.4 FPS, no errors).cargo testpassed for the crates it touches: yes. WithVICTORY_WARP=1,cargo test -p victory-gpu --lib -- held_copy placed aliaspassed 24 of 24. That includes the newresource::tests::a_copy_into_a_held_copy_takes_its_own_level, which checks the subresource mappingand extent check: title level 0 of a copy beginning at level 3 maps to none, level 3 to 0, and slices
map to the copy's own slices.
cargo clippy -p victory-gpu --all-targets(with and withoutdiagnostics): no finding in thechanged lines. main's own findings are unchanged.
cargo xtask policy --staged: 3 files ok.What to look for in a run on main: the log line
a copy into a view placed over a texture the host copied into is left out(fieldsbase,why). With the debug layer on, there should be noCopyTextureRegion ... only has 128 widthand no failed Close.Checked for overlap
held_subfor title copies, plusfit_copy). It says "the placed twins andbakes still read the title's indices". Its
fit_copywould cut such a twin copy to the smallerlevel's room, which avoids the crash but writes level-0 texels into the twin's first held level.
This PR maps twins to the right level. The two touch the same twin lines in
list.rsand would need asmall merge.
generically. This PR fixes where this copy comes from.
🤖 Generated with Claude Code
The copies into views placed over a texture the host copied into (placed_twins, VICTORY_PLACED_COPIED) wrote into the twin's host copy at the title's subresource index. A twin's host copy can begin at a later level (held levels, VICTORY_HELD_LEVELS, on by default), and once the host wrote the twin (seed_later marks it at texture_at, or an earlier copy) want_level keeps it as it is: seed_pending's own want_level(view, 0) returns early for it, and the twin loops ask want_level only for twins not written yet. A bake's copy into level 0 of a 1024x1024 BC7 texture then went into the twin's 128x128 level 0; D3D12 refuses it and the host list does not close ("The destination region extends past ... BC7_TYPELESS ... only has 128 width", issue #2914's second case). resource::host_target maps title level L to host level L - base of the same slice (host_subresource) and checks the host level is as large as the title's (same_extent); a level the copy does not hold gets no copy (twin_copy_left_out: counted, the first 16 said). A whole CopyResource into a twin is made only when both host textures are laid out alike. seed_pending offsets the source's level by the bases of both copies (it compared footprints and refused the seed instead). No switch: it only leaves out or redirects copies D3D12 refuses. Test: resource::tests::a_copy_into_a_held_copy_takes_its_own_level. Co-Authored-By: Claude Opus 5.5 <[email protected]>@tyr0nsur on GitHub · 2026-11-30 08:52 UTC · original
I found a valid copy that the new host_target bound drops. In D3D12,
subresource / mip_levelsisarray_slice + plane_slice * array_size. Comparing that quotient with just the array size drops the stencil plane. The placed-twin path can pass a plane-bearing subresource index through when the title layouts have the same array size.Follow-up commit
95f9b2a, based on523485b, counts the host DXGI format's planes in the bound. The mip remapping and extent checks are retained.I added a synthetic D24S8 array test with two slices and one mip. The D3D12 format query reported two planes. With only the test added to this PR head,
host_targetrefused the first stencil subresource (index 2). With the follow-up, it accepted indices 2 and 3, the driver returned valid 16×16 footprints, and index 4 was still refused. The regression passed on the RTX 4060 (621.14) and Microsoft WARP (VICTORY_D3D12_WARP=1in the diagnostics build). The diagnostics resource suite reported 46 passed and one ignored, and staged asset policy passed. Review assisted by Claude Opus 5.5.@tillo88 on GitHub · 2026-11-30 12:44 UTC · original
Tested on top of v2026.11.29.05 (head
523485b, merges cleanly, builds) against #2237's crash, thea host command list did not close (0x80070057)at the prison -> plane cutscene cut, on an unattended replay bench: same save restored before every run, controller input played back withVICTORY_INPUT_REPLAY, release build, Series X 1440p, DLSS Quality, FG off, RT off, Ryzen 7 9800X3D + RTX 5070 Ti 16 GB (driver 621.40), 32 GB RAM, Windows 11."list close" is
a host command list did not close (0x80070057), "device lost" isrelay: the device was lost. Runs include the warm-up runs, as only crashes are counted here; one #3792 launch that ended after 3 s is left out.The three crashes with this PR are the same failure at the same second as on the release: +2:16 to +2:17, one second after the masked twin
[mesh 480d53fc48107a50, pixel f41ec9d9437c021c-mask]is made. The linea copy into a view placed over a texture the host copied into is left outdid not appear in any of the 14 runs. So on this route the list-close failure is not, or not only, the held-copy case this fixes. That doesn't say the change is wrong: no new failure showed up with it (the game access violation at +4:57 also happened once with #2305), and the +6:00 one came after the replay had left the route. These runs used the head before the stencil-plane follow-up95f9b2amentioned above. Details and timings in #2237.Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.
@Freeman022026 on GitHub · 2026-11-30 13:53 UTC · original
Tested on v2026.11.29.05 (
41adb551) with the stencil-plane follow-up included, in a patched build alongside #3043, #3487, #3730, and #3816. System: Ryzen 7 7800X3D, RTX 4090 24 GB (driver 621.14), 64 GB RAM, Windows 11, Series X profile, 2560x1440, DLSS Performance, 2x Frame Generation, RT off.Prior runs on this setup hit
a host command list did not close (0x80070057)in 7 of 8 sessions, including a 47-minute stock.05run entering the city center. With this PR applied, an 81-minute run through the city center finished with 0 crashes.During the run, the guard fired 15 times (
why="level not held",subresource=0..2,base=Some(3)), leaving out placed-twin copies whose host copy began at a later mip level. The unit testresource::tests::a_copy_into_a_held_copyalso passes on the RTX 4090.@Mikey970 on GitHub · 2026-11-30 13:54 UTC · original
@tyr0nsur thanks, confirmed: the subresource index over the mip count is
array_slice + plane_slice * array_size, so bounding it by the array size alone refused the stencil plane. I took your95f9b2aonto this branch as-is (fast-forward, your authorship), so the bound is nowslices * planeswith the mip remap and extent checks unchanged.Checked here on WARP (
VICTORY_WARP=1): youra_placed_copy_target_keeps_the_stencil_planefails with the old bound (index 2 refused) and passes with95f9b2a;a_copy_into_a_held_copy_takes_its_own_levelstill passes. Clippy onvictory-gpu --all-targetsadds no warning in the touched code (the CIcheckfailure is the pre-existingunwind_copyone onmain41adb551).@tillo88 thanks for the replay bench. Noted: on your route the list-close at the prison → plane cut is a different failure from the held-copy case (the left-out line never fired), and nothing new failed with this PR. On our route the debug layer named the out-of-bounds BC7
CopyTextureRegionthat this fixes, so I'd read it as one cause of that error, not the only one.🤖 Generated with Claude Code
@Mikey970 on GitHub · 2026-11-30 14:44 UTC · original
Note: this PR had already been merged into
mainbefore this follow-up was pushed, so3a9e9a69is only on the fork branch, not inmain. It will come as a separate PR.Follow-up
3a9e9a69: a wholeCopyResourceinto a title texture whose placed twin's host copy holds fewer levels was left out, so that twin kept stale contents. It now compares the copy's real ends (the twin's host copy and the source's, not the destination's). When they are laid out alike it stays oneCopyResource. When they differ, every subresource both ends hold at the same size (host_targetat both ends: level, array slice and plane) gets its ownCopyTextureRegion, and the copy is left out only when no subresource is held alike.Tested: new
a_whole_copy_into_a_held_twin_takes_the_levels_both_holdplus the existing held-copy and stencil-plane tests pass (WARP); clippy onvictory-gpu --all-targetsadds no warnings.🤖 Generated with Claude Code
Pull request closed