d3d12: keep a title's page protection across lazy publication #647
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/647"
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 brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-02T06:44:45Z.
Fixes #625.
Summary
Lazy publication (on by default since
e40d8052) records each page's protection when it defers a texture, and gives that protection back on release. A page the title closed before the GPU wrote, and opened again before its first access, was closed again by that release. The title's next read of it faulted, and no handler took it. Lanestexture-publicationdied with exit 5.Pages::releasestill restores the protection from deferral time, so the write-back sees the pages as an eager publication would and leaves the page the title had closed alone.lazy::releasereturns them in aReopenguard that sets that protection again when it drops.publish_texturekeeps the guard across the write-back. The access handler, a texture's teardown and #640's release of dead textures before a userptr import drop it at once.Not covered: a page the title closes while it is held still looks like one lazy publication closed (
PAGE_NOACCESS), and release opens it again. Nothing I have reproduces that.Rebased onto #640: the deferral keeps its userptr check before
protect, and #640's unit test now passesset_protectionasrestoreand checks that nothing comes back to reopen.The failure elsewhere
lanes-selftest-texture-publicationfails the same way on main on other cards: an RX 6950 XT in #631's check, and an RTX 5090 and an AMD iGPU in #630's (both list it as #625).Verification
RX 6600 (1002:73ff, RDNA2), Mesa 26.3.1 RADV, GE-Proton11-15.
3e2839b1(this branch): all d3d12 unit tests under Wine (cargo xwin test --locked -p tuxbox-d3d12 --lib): 603 pass; the 3scene_publicationtests need a hardware device and fail the same way on main. The new testa_page_the_title_reopened_while_held_is_handed_back_for_after_the_writefailed before the change. Formatting clean; clippy reports onlyfetch_updatedeprecated inshader_cache/native_doubles.rsfrom #642, not this change.2a850114+ #640 + this fix (the samelazy.rs,writeback.rsand test file as this branch), default settings, lazy publication on:tuxbox.py verify --only lanes-selftest --only lanes: 31/31, includingtexture-publication(5/5 FAIL before, 4/4 PASS withTUXBOX_LAZY_PUBLICATION=0).PERMISSION_FAULTS 0xb, at0x00000700137ff000; the ring reset succeeded.3e2839b1without this change also reached the world (mission frame 1153) and ended after 446 s on the #603 TCP read fault (PERMISSION_FAULTS 0x3); the ring reset succeeded. It had no SQC fault, and lazy publication published nothing on access, so this change's path did not run there. With one run each, I can't tie the SQC fault to this change. Both runs end on a GPU fault after a similar time in the world.🤖 Generated with Claude Code