d3d12: read and detile only the written levels of a write-watched texture (D3D12-TEXTURE-DIRTY-MIP-DETILE) #3072
Open
zmasi wants to merge 5 commits from
upstream-pr/3072 into main
pull from: upstream-pr/3072
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
ProjectLeonida/mandy!3072
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3072"
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 ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T09:07:18Z.
Claimed in the coordination issue as:
D3D12-TEXTURE-DIRTY-MIP-DETILE(https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7331141228)What and why
Previously, a write observed by the write watch anywhere inside a staged texture caused
Staging::refresh_timedto copy the entire texture out of title memory (copy_mapped) and CPU-detile every mip level of every array layer (texture.rs's module comment notedshortcut: a change detiles the whole texture, not the pages written).This change maps the written pages to the texture parts (
(mip, slice)subresources, with packed tail mips in a slice sharing their block) that overlap them, reads each contiguous run of dirty parts into its exact offset in the thread's scratch read buffer (read_runs/read_written), and CPU-detiles only those dirty parts into the persistent staging buffer (Staging::detile_parts) while leaving untouched levels intact:LEONIDA_PARTIAL_DETILE(on by default;=0restores whole-texture copy + detile;LEONIDA_AB-toggleable viacrate::toggled!, documented ind3d12/docs/switches.md). Turning it off clears the sparing budget so toggling0 -> 1mid-run always re-seeds from a full read first.refresh_timed(never on hash/guard turns, bakes,on_demandresidency textures,LEONIDA_INPLACE, copy-timing modes, 3D/MSAA textures,>64parts, or all-shared-page layouts), on hosts where first touch of a newly committed write-watched page is noted, after a full read verified every page resident as private memory in a single write-watched allocation, while preceding spared gaps remain resident private pages validated in forward address order before each run copy (all_private) with no unasked kernel writes (GetWriteWatchwithout reset) and an even, unchangedwatch::changes()epoch, bounded to at most 16 consecutive sparing refreshes (SPARING = 16) before a full refresh. Any failed check falls back cleanly to the existing fullcopy_mapped+ full detile path.d3d12/crates/leonida-gpu/src/texture.rs(384 KiBvs640 KiBcap) +d3d12/docs/switches.mdare the only files touched (merge-clean with #2841).monte-alt/vesper3cf0c18(GPL-3.0), "Limit trusted dirty-mip reads to the selected texture span", extended here to per-run disjoint reads without holding the title-memory read lock and guarded by kernel working-set / non-resettingGetWriteWatchvalidation and bounded sparing.Measured (release build, synthetic
1024x10242-layer 10-mip2.8 MBBC7 texture, 11 runs on Ryzen 9 5950X)64 KiBlevel31–40 us(43–60 uscold)54–66 us(70–90 uscold)385–496 us(~7–12x faster)256 KiBlevel47–55 us67–79 us377–455 us(~5–7x faster)1 MiBlevel165–187 us(211 usonce)179–207 us(235 usonce)396–427 us(~2.2x faster)419–485 us397–447 us(+13–38 uspage-validation overhead)(Synthetic host benchmark only; no retail title was run.)
Tested
cargo test --target x86_64-pc-windows-msvc -p leonida-gpu --lib -- dirty_mip_detile written_parts --nocapture(with and without--features diagnostics, and underRUST_TEST_THREADS=1): 14 checks covering poisoned scratch buffers (0xAA/0x55), packed tail mips, multi-slice 2D arrays,on_demandresidency flips, short-read / decommitted /PAGE_NOACCESSforward-order gap validation, concurrent mapping-epoch changes, competing write-watch askers, 16-refresh lost-note self-repair, excluded layouts, andLEONIDA_PARTIAL_DETILE=0parity (gracefully printsSKIPwhen no D3D12 host or qualifying write-watch is available).python -I scripts/red_green.py: red on base (9/10 switch-on checks fail, e.g.2,883,584bytes read where65,536are due), green on HEAD.cargo test --workspace --exclude xtask --locked --no-fail-fast -- --skip depth_bounds_pipeline_loads_and_filters_draws: all 32 workspace test binaries green (695 passed, 0 failedinleonida-gpuon currentmain).cargo clippy --target x86_64-pc-windows-msvc -p leonida-gpu --lib --tests --no-deps(0warnings intexture.rs),python -I tools/d3d12_switches.py --check d3d12/docs/switches.md(rc=0), andpython -I scripts/check_no_game_data.py(rc=0).GPUs tested: NVIDIA GeForce RTX 3090, driver 32.0.16.1088 (610.88), Windows 11 Pro 10.0.26200 (synthetic D3D12 unit-test host only; no game files).
AI-assisted: yes — authored with Claude Fable 5.2, design & diff audited across 9 rounds by GPT-6.2 Astra (
xhighread-only Codex CLI + rubric), and independently reviewed by a separate read-only Claude Opus 5.5 reviewer agent.Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — no shader translator rule changed)Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T09:47:45Z.
Windows 11, MSVC toolchain 1.98.1. Head
06998df00merged into currentmaina917c54d6: the merge is clean. Unit tests only, no game.The tests ran for real here, not as a skip. With
--nocapture, thedirty_mip_detileandwritten_partstests printed noSKIPon the hardware device or on WARP, so this host qualifies.partial_detile()answer false.the_levels_written_are_read_alone_and_all_of_a_texture_as_beforethen fails with 7 of its checks:a_written_page_has_its_level_read_and_detiled_alone,levels_written_apart_are_read_apart,a_texture_read_from_a_later_level_has_its_written_level_read_alone,a_written_level_that_cannot_all_be_read_has_the_whole_texture_read,a_level_taken_anew_is_read_again_with_the_next_write,a_texture_with_levels_on_demand_is_read_wholeanda_write_the_write_watch_lost_is_read_with_the_whole_texture_in_its_turn. With the change: 4 passed, 1 ignored.cargo test -p leonida-gpu --lib, in parallel: 695 passed, 0 failed, 60 ignored.cargo test -p leonida-gpu --features diagnostics --lib, in parallel:LEONIDA_D3D12_WARP=1)LEONIDA_D3D12_DEBUG=1LEONIDA_PARTIAL_DETILE=0cargo clippy -p leonida-gpu --features diagnostics --lib --tests: no warning intexture.rs.python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: exit 0.Not checked: the release bench, and the game.
GPUs tested: one NVIDIA desktop card + WARP.
AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T11:39:22Z.
Verified locally on Windows 10 22H2 + NVIDIA GeForce RTX 5070 12 GB (driver
621.40, 16C/32T desktop CPU), PR head06998df00merged cleanly ontomaina252854a2:cargo test -p leonida-gpu --locked --lib texture::-- exit0(28 passed, 0 failed, 5 ignored measurement benchmarks).python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/texture.rs d3d12/docs/switches.md-- exit0.diagbuilddiagnostics,dlss,mimalloc, Series S,-NoFrameGen -NoPrecompile,LEONIDA_AB=8,LEONIDA_PARTIAL_DETILE, 8 s turns, standing in-world, ~4,420 draws/frame):ERRORlines across 49 A/B phases (397 s total, 260 s in-world; overall 3000-4999 draws median 26.4 fps, texture refresh0.5 ms/2.3 MBper frame).Result: PASS -- unit tests pass, 0 runtime errors, and clean non-regression standing in-world (where per-frame texture detile load is only ~0.5 ms; larger gains are expected during heavy streaming/driving).
AI-assisted: yes (Antigravity).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:12:01Z.
Checked #3072: the switches registry passes merged onto current
main(Linux); the Rust was reviewed at the level of its design, not built (Windows-only). The code is careful and tested, but it adds about 2,000 lines to a hot path, on by default, and the only in-game A/B shows no frame-time change.06998df00emain45dc41f95c(clean merge treebbeb07c30f; merge basea917c54d6a, 184 commits behind)d3d12/crates/leonida-gpu/src/texture.rs+2,015 / -42,d3d12/docs/switches.md+11 / -10partial_detile()false: 7 checks fail; crate green on hardware, WARP, WARP + debug layer), lixonik (RTX 5070 / 621.40: unit tests, plus an in-run A/B withLEONIDA_AB=8,LEONIDA_PARTIAL_DETILE)Ran (Linux, on an export of the merge tree with its own
git init)Review
LEONIDA_INPLACE, copy-timing modes, 3D/MSAA, more than 64 parts, or a mapping change in flight (oddwatch::changes()). Any failed check falls back to the old whole copy and detile, and at mostSPARING = 16sparing refreshes run in a row before a whole one.detile_partsstill reports a failed detile, and the refresh then counts zero sparing. The switch is A/B-able, and=0restores the old path.Concern (engineering bar, not a bug). AGENTS.md asks for simple code on hot paths and for measured gains (
docs/measuring_fps.md). This is about 2,000 lines of subtle invariants (working-set queries, non-resettingGetWriteWatch, epoch parity) whose failure mode is a stale texture level, on by default, without a measured frame-time gain. Before merging, I would ask for one of:docs/measuring_fps.md, that shows a gain; orLEONIDA_PARTIAL_DETILE=1to opt in) until such a run exists.The
monte-alt/vesper3cf0c18(GPL-3.0) attribution is compatible withd3d12/(GPL-3.0-or-later).Verdict: defects (needs a measured gain, or default off). No correctness defect found in what I read.
AI-assisted: Claude Opus 5.5 (Claude Code), review only.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T18:32:37Z.
Thanks @MoonEyes — makes complete sense on the hot-path bar. Implemented Option 2 in
192640e94f(merged with currentorigin/main):partial_detile()fromtoggled!toasked!("LEONIDA_PARTIAL_DETILE"), so partial write-watched mip detiling is now off by default (default path 100% unchanged;LEONIDA_PARTIAL_DETILE=1opts in, andLEONIDA_AB=<s,>LEONIDA_PARTIAL_DETILEstill toggles it live for driving/streaming A/B runs).dirty_mip_detile_tests/written_parts_testschild-process harness to testLEONIDA_PARTIAL_DETILE=1alongside both unset (default-off) and=0, and regeneratedd3d12/docs/switches.md.Verified on
192640e94f:cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib texture::->28 passed; 0 failed(and--features diagnostics texture::dirty_mip_detile_tests-> passed)python -I tools/d3d12_switches.py --check d3d12/docs/switches.md&python -I tests/test_d3d12_switches.py->20/20OK.Imported from ubiquitarianism/leonida. Originally posted by icdmkg2 on 2026-12-02T20:35:20Z.
Third-party Windows verification of #3072 (
D3D12-TEXTURE-DIRTY-MIP-DETILE) on opt-in head192640e94Follow-up Windows verification of the new opt-in head (
LEONIDA_PARTIAL_DETILEswitched toasked!, off by default).192640e94faf050434da3889344774cbd609d17amerged cleanly (git merge --no-ff) ontoorigin/mainb41763227.621.24(32.0.16.2124), AMD Ryzen 7 H 260 w/ Radeon 780M, 32 GB RAM, Windows 1110.0.26300.9974,rustc 1.98.1.Results (MEASURED)
python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/texture.rs d3d12/docs/switches.md0python -I tools/d3d12_switches.py --check d3d12/docs/switches.md0python -I tests/test_d3d12_switches.py20/20OKLEONIDA_ADAPTER=5060cargo test -p leonida-gpu --features diagnostics --locked --lib -- texture::28 passed, 0 failed, 6 ignored(exercisesLEONIDA_PARTIAL_DETILE=1, unset default-off, and=0)LEONIDA_ADAPTER=5060+LEONIDA_D3D12_DEBUG=1cargo test -p leonida-gpu --features diagnostics --locked --lib -- texture::dirty_mip_detile_tests1 passed, 0 failed, 1 ignoredLEONIDA_D3D12_WARP=1+LEONIDA_D3D12_DEBUG=1(samedirty_mip_detile_testscommand,--features diagnostics)1 passed, 0 failed, 1 ignoredCode note (READ IN CODE)
partial_detile()now usescrate::asked!("LEONIDA_PARTIAL_DETILE"), keeping the default path unchanged unless explicitly opted in or toggled viaLEONIDA_AB.AI-assisted: Gemini 4 Neon (High) via Antigravity (test execution, diff review, and write-up).
Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-12-02T21:02:42Z.
RUN (standalone RTX 3090 300 s stress gate + Windows red/green unit tests) — PASS covering exact head
192640e94faf050434da3889344774cbd609d17a.80910637f(diagnostics,dlss,mimalloc,exe_sha16 = 7e7b83c6c34f6399; changed-file clean-room scan exit0).80910637f): focused dirty-mip test read2,883,584bytes where it expected65,536.cargo test -p leonida-gpu --lib --locked -- --test-threads=1passed707default /788with--features diagnostics.610.88, Series X profile,2560x1440,-NoFrameGen,LEONIDA_PARTIAL_DETILE=1,scripts/game-gate.ps1(301.9 sin world) with downtown street-level teleport + 8-leg dynamic sprint/turn/strafe stress mod (GATE CONTROL moved=1.10 m,max_from_ctrl=5,073.6 m).#3072(LEONIDA_PARTIAL_DETILE=1,7e7b83c6c34f6399)mainb41763227baseline (cf499737bf684f6a)clean,0reasons,0warnings)clean,0reasons,0warnings)301.9 s305.6 s0/0/00/0/020.45 FPS/68.68 ms19.13 FPS/74.01 ms7,812/6.885 s7,983/2.358 s38,148 MB/15,560 MB37,803 MB/16,220 MBVerdict: PASS for the 300 s standalone in-game gate on
192640e94withLEONIDA_PARTIAL_DETILE=1active. (Single-run stability gate; we also plan an in-processLEONIDA_AB=4,LEONIDA_PARTIAL_DETILEmeasurement next.)(AI-assisted verification:
gemini-4-neon+gpt-6.2-astra.)Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T23:47:06Z.
VERIFY-3072 — Windows nativo:
red then greenen el interruptor192640e94—texture.rs(+48/−…),docs/switches.md(4 lines)Ran at the head
Negative control (synthetic): I made
partial_detile()returntrueunconditionally — the switch forced on, the opposite of what the pull request makes it — and rebuilt:It bites, and the failing test's name says exactly what was broken: with the switch off, the whole texture must be read, and my mutation made "off" impossible.
What the change is:
LEONIDA_PARTIAL_DETILEbecomes opt-in by default — the switch is nowcrate::asked!(...), so unset means the old whole-texture read — anddocs/switches.mdsays so. Turning a default off is the kind of change that needs a test on the unset path, and this one has it: the failing name is the unset path.What I could not test: the detiling itself on a title's texture — the tests drive the parts/pages bookkeeping, and the run numbers quoted in the comments (72, 73) are the author's.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-12-03T02:16:41Z.
Follow-up RTX 3090 paired performance verification on unchanged head
192640e94faf050434da3889344774cbd609d17a: two additional sequential in-game runs completed, one idle and one with sustained traversal. Both passed a 300 s world gate and exited cleanly with 0 crashes/device losses. This extends the stability report above; it does not establish an FPS gain.Windows 11 Home build 26200, Ryzen 9 5900X, 32 GiB RAM, RTX 3090 24 GB, NVIDIA 610.88. Series X title upscaler, 2560x1440 output, no frame generation, warm cache, same restored save template, no concurrent build/test suite.
LEONIDA_AB=4,LEONIDA_PARTIAL_DETILE; these are within-run neighboring off/on phase comparisons, not separate-run ABBA.Traversal was verified from 25 post-teleport warm position samples over 240.7 s: at least 171.4 m traveled, with movement in every third of the analysis window. All 13 accepted pairs were bracketed by movement. The on-phases still averaged 269 ± 103 more draws/frame, so residual scene variation limits attribution. Idle submitting-thread work fell 1.10 ± 0.50 ms/frame; traversal work changed +0.41 ± 0.47 ms/frame.
Verdict: five-minute stability PASS in both runs; frame-time improvement inconclusive (both intervals include zero). One session per condition, no visual-correctness verdict and no isolated RAM-saving claim.
Provenance: historical staged source head above, recorded base
80910637f14f212553135e06907cae81ade1b46d, executable SHA-2567e7b83c6c34f63992d855441fec119b9b9dbd51dc86a46ac6a99ab5b598fa244, featuresdiagnostics,dlss,mimalloc. Launcher checkoutb41763227; this is not a fresh integration test against today's main. Raw logs/captures remain private.AI-assisted: GPT-6.2 Astra ran and analyzed the captures; GPT-6 Astra inspected the sanitized report and posted this follow-up.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T03:32:31Z.
Merged
origin/main(516c9eaabf) into98a5322491strictly to regenerated3d12/docs/switches.md(needs rebase);d3d12/crates/leonida-gpu/src/texture.rshas a byte-identical diff againstorigin/maincompared to192640e94f(verified by @EdenBendheim and @fiestorra above).AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T04:29:39Z.
RUN (in game, batch of two pull requests), each head merged with
git merge --no-ffonto main516c9eaab, in one build: #2789b511f5c93, #307298a532249. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used, so the default start (every known pipeline precompiled) was not exercised. Both were in earlier batches on other heads; this run covers their current heads. #2789's discard of stale pipeline libraries only acts after a driver update; the driver did not change here, so that path was not exercised.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T04:42:47Z.
Integration check on
98a532249with #3291 ata643d5ae. Git reports one conflict in the generatedd3d12/docs/switches.md. I regenerated it from the paired sources, then ran the stricter checker from #3270 and all 21 catalog tests successfully.The combined tree builds the
leonida-gputest binary forx86_64-pc-windows-msvc. Under Wine, all five frame-time tests and the two CPU dirty-part tests run and pass. The kernel write-watch case printedSKIPbecause this host does not qualify, and the staging cases printedSKIPbecause no D3D12 host was available. This covers the paired source build, catalog, and CPU checks. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T11:32:46Z.
Merged
origin/main(6e97990505,#3318) into0f1e26355estrictly to regenerated3d12/docs/switches.md(needs rebase);d3d12/crates/leonida-gpu/src/texture.rshas a byte-identical diff againstorigin/maincompared to98a5322491.AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T14:32:01Z.
RUN (in game, third party, batch of five pull requests), each head merged with
git merge --no-ffonto mainb053a1813, in one build: #2686c5269801b, #26432e0b23a00, #27894cd9d71f8, #30720f1e26355, #299991537d2af. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.6 fps on other runs today: a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it. #2834 was left out of the batch (it conflicts with the others).
Limits: one run; arrival in the world was driven by keys and not checked on pictures. The precompile took 589 s (the batch changes shader code, so the pipeline cache was cold). Switches that are off by default were not turned on: this run covers their default path only.
AI-assisted (Claude Code, Claude Opus 5.5).
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.