d3d12 hwrt: the meshlet index cache is bounded; opt-in shown structures and recorded transforms (D3D12-HWRT-MESHLET-BOUND) #3297
Open
OreoFR wants to merge 6 commits from
upstream-pr/3297 into main
pull from: upstream-pr/3297
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!3297
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3297"
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 OreoFR on 2026-12-03T05:23:58Z.
Item: D3D12-HWRT-MESHLET-BOUND (claimed in #2570).
Extracted from tomk134's local branch (github.com/tomk134/mandy,
local/2026-12-03, 844265408). Its hardware-RT pieces port Darner (codefloe.com/TrustNo1/Darner, GPL-3.0-or-later like this repo): 79548f7 for the meshlet cache bound andshown, 6a5f7eeb for the recorded transforms. Credit goes to both.What changes
decoded_ibskept every decoded title meshlet index buffer (a committed UPLOAD buffer each) for the whole session.LEONIDA_HW_RT_MESHLET_CACHE_MB;0= no bound, as before).LEONIDA_HW_RT_SHOWN=1, off by default (a trial).HostList::at_submit. Today they name whatas_mapholds, which is recorded up to a frame ahead, so a top level can name structures the card has not built yet.LEONIDA_HW_RT_TX_COPY=1, off by default (a trial).Tested
MeshletCachetests:0is unbounded;cargo test -p leonida-gpu: 721 passed, 59 ignored.cargo clippy -p leonida-gpu --all-targets -- -D warnings: clean.switches.mdregenerated (731 names) and--checkOK;check_no_game_dataOK.Needs: an in-game run with
-HardwareRT: the default path (the bound), thenLEONIDA_HW_RT_SHOWN=1andLEONIDA_HW_RT_TX_COPY=1.AI-assisted (oreofr-agent, Claude Code).
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T05:37:22Z.
Review: COMMENTED
Reviewed the default cache path on
dd1c4d2emerged ontod9b618f10. The Windows MSVC build passed. Under Wine, all five new cache tests passed. The widerhwrt::testsfilter gave 26 passes and the sameREMAP_HLSL compilesfailure that I reproduced on exactmainin the same Wine setup. All 20 catalog tests passed.[P3] Preserve older cache entries when current-frame entries leave too little room for a miss. With an 8 MiB limit, 7 MiB touched this frame, and one older 1 MiB entry, a 2 MiB miss evicts that older entry and still returns the new buffer without caching it. I reproduced this in the exact
MeshletCachecode: the returned values are[older, new]. Checking the reclaimable bytes while collecting older candidates lets this case return just[new], keeps the cache within the bound, and passed the five stock tests plus the new case. That would avoid an extra miss if the older entry is needed again. The fixture used numeric stand-ins for buffers. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T05:44:06Z.
VERIFY-3296 — 718/1 y 720/1: las dos con la falla de la iGPU como única, y el
opt-inen las dosLas dos últimas de OreoFR, y las dos con el mismo patrón de la de ayer:
718 y 720 contra los 715 de
main— tres y cinco tests nuevos, y en las dos el único fallo esviews_are_made_beside…, el de la iGPU de esta máquina.#3296— un tope por barrido de texturasY es el hermano de
#3291(tope al tiempo total de las pasadas de un frame): el mismo autor, la misma idea, una granularidad distinta — allí el frame entero, aquí cada barrido. Y las dosopt-in.Que esa decisión se repita cuatro veces en tres PRs (
#3290,#3291,#3296,#3297) es lo que quiero acreditar: no es que el autor prefiera interruptores por comodidad — es que en un repositorio donde cada cambio de memoria o de tiempo se mide engpu-test-results/con la misma máquina y el mismo título, un cambio siempre-encendido invalida las filas anteriores. El interruptor es lo que permite añadir una fila.#3297— el caché de índices de meshlets, acotado432 líneas en
hwrt.rs, el más grande de los cuatro, yswitches.mdcambia con él en los dos — que en este repositorio es la señal de que la superficie que el jugador puede tocar cambia.Lo que verifiqué en las dos: la suite completa del crate, con la única falla conocida.
Lo que no: que el caché se acote de verdad ni que el barrido mejore el frame — los dos son estados que se provocan con el título y se miden con una fila de
gpu-test-results/, y ninguna de las dos PRs trae una.Y lo que pediría, con
#2379ya en la cola: cuando entre la herramienta que resume los registros, estas cuatro PRs son las primeras que deberían tener su fila.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T05:44:19Z.
Corrección de un número mío en el comentario anterior: 6 y 18, no «tres y cinco»
Escribí «718 y 720 contra los 715 de
main— tres y cinco tests nuevos», y eso es aritmética sobre dos números que no se pueden restar: las bases de las dos ramas no sonmainde hoy, así que718 − 715no es el número de tests que añaden.Medido en el diff de cada una (
merge-base..head):Y la diferencia con mi resta es exactamente la misma que corregí esta mañana con los conteos de i18n: restar dos números medidos en árboles distintos y llamar al resultado «lo que añade la PR». El total de la suite sí se puede comparar (los dos son de hoy); el desglose, no.
Lo que no cambia del comentario: las dos pasan con la única falla de la iGPU, las dos son
opt-in, y la reflexión sobre por qué el interruptor se repite en cuatro PRs sigue en pie.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T05:44:37Z.
Thanks @merzleckeier, fixed in
83c2a9279.insertnow sums what the older entries would give back before evicting anything. When that cannot make room for the miss, it drops nothing and returns the buffer for one use. Your case isolder_entries_stay_when_this_frame_leaves_too_little_room: it returns just[new]and the older entry is kept.cargo test -p leonida-gpu: 722 passed. Clippy: clean. Without the check, the new test fails. (oreofr-agent, AI-assisted)Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T05:51:35Z.
Confirmed the fix at
83c2a927with the exact cache code. All six cache tests passed, including the new regression. I also checked the boundary with an 8 MiB limit, 4 MiB touched this frame, and one older 4 MiB entry: 3 MiB and exactly 4 MiB requests evict the old entry and cache the miss. A 5 MiB request returns only its own buffer and leaves both entries in place. The previous head failed that last case by retiring both the old entry and the new buffer.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T06:09:11Z.
RUN (in game, RTX 5070 12 GB, Hardware RT, 315 s in-world gate) -- PASS on head
dd1c4d2e7(merged cleanly viagit merge --no-ffontomaind9b618f10).Build & Unit Checks (Windows 10 x64, RTX 5070 12 GB, driver 595.79)
python -I scripts/check_no_game_data.py-> PASSpython -I tools/d3d12_switches.py --check d3d12/docs/switches.md-> PASSLEONIDA_D3D12_DEBUG=1 cargo test -p leonida-gpu --features diagnostics --lib --locked hwrt-> 27 passed, 0 failedcargo build --profile diag --features "diagnostics,dlss,mimalloc" --locked-> PASSLive In-Game Gate (
-SeriesS -NoFrameGen, Hardware RT:LEONIDA_HW_RT=1,LEONIDA_AMBIENT=0,LEONIDA_RT_RESOLVE=1,LEONIDA_ACTIVATE_RAYS=1, default 256 MB meshlet cache bound)315 sin world (488.3 stotal,63world samples>= 1000draws, max4,768draws)0/0/0d3d12_run_fps.py): median24.9 fps(40.2 ms;3000-4999draws median25.0 fpsacross57samples; slowest tenth6.8 fpsduring world entry, fastest tenth25.6 fps)hardware DXR 1.1 RT manager initialized (LEONIDA_HW_RT=1) tier=11; final countersBLAS live 5152(built 17724,refit 306530,refit->rebuild 934,rehydrated 3342),TLAS live 5(builds 34632),BLAS memory: budget 1075 MB, live 582 MB (4896 BLAS), evicted 0. (Opt-inLEONIDA_HW_RT_SHOWN/ recorded-transforms switches were left at default off in this run.)AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T06:15:00Z.
RUN (in game, one pull request), its head merged with
git merge --no-ffonto maind9b618f10: #329783c2a9279. 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 pull request, on the head above. If it 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. Hardware ray tracing was not on in this 8 GB profile, so the bounded meshlet index cache and the opt-in shown structure were not exercised: this run shows the default path is unharmed, nothing more. An earlier run on headdd1c4d2e7is not reported: the head moved during it.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T06:15:38Z.
Review: COMMENTED
[P2] Capture transforms only for opted-in recorded builds. On
83c2a927,read_geometriesrunstitle_readable(VirtualQuery) and copies 48 bytes for every readable nonzero transform, even withLEONIDA_HW_RT_TX_COPY=0. The flag is checked only when using the saved value later. The prebuild query uses the same decoder and needs only the zero/nonzero address bit, so it also pays for snapshots it discards.I compiled the exact decoder and memory query with MSVC and fed it 16,384 generated triangle descriptors with a valid synthetic matrix under Wine 11.22. The current off path captured all 16,384 matrices (median 12.15 ms for the decoder). Checking the flag once before the loop captured zero with it off (0.44 ms) and still captured all 16,384 with it on (12.15 ms). These timings are for Wine and the fixture. The count verifies the behavior independent of timing.
Please gate capture on the recording path and leave it off for prebuild sizing. That keeps reads out of both the default path and calls that only compute sizes. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T06:52:51Z.
Thanks @merzleckeier, fixed in
583860881.read_geometriestakes arecordflag. The prebuild sizing query passes false, the two recording paths pass true.LEONIDA_HW_RT_TX_COPYis read once per call.capture_transformqueries title memory and copies the 48 bytes only when the switch is on, the build is recorded and the transform is set.cargo test -p leonida-gpu: 723 passed. Clippy: clean. With the gate removed, the test fails.(oreofr-agent, AI-assisted)
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T07:01:08Z.
Confirmed the transform-capture fix at
58386088. I reran the decoder with 16,384 synthetic triangle descriptors per call and counted its memory queries and snapshots. Prebuild sizing performs zero queries and takes zero snapshots with the switch at either0or1. A recorded build with the switch off also produces zero of each. With it on, the recorded build queries and captures all 16,384 transforms, and every copied matrix matches.I also combined this head with the announced BLAS pool branch at
8c98f430ond9b618f1. The only merge conflict was the generated switch catalogue. After regenerating it, all 20 catalogue tests passed. The combined Windows MSVC diagnostics build passed 28 HWRT tests under Wine 11.22, including the new transform test. I excluded the existingREMAP_HLSLcompilation test after confirming the same Wine failure on plainmain. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by x2Tweek on 2026-12-03T07:29:53Z.
RUN (in game, RTX 5090 32 GB,
-HardwareRT, default path): PASS, 0 device losses, no regression I can measure.583860881merged withgit merge --no-ffontomaind9b618f10(mergebfa6bda9d, clean). No other changes.diagnostics,dlss,mimalloc.-HardwareRT -SmoothMotion -PrecompileAll -Log,LEONIDA_D3D12_DRED=1. This PR's switches are left at their defaults: the cache bound is on at 256 MB, andSHOWNandTX_COPYare off.L/J, 20 s each way) to keep new BLASes and meshlet buffers coming. 600 s in the world.mainalone, same scenariomainwithin one run's noise.AI-assisted: the builds, the automated runs, the log reading and this write-up were done with Claude Opus 5.5 (Claude Code); the numbers are the runtime's own log lines.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T07:31:26Z.
RUN (in game, one pull request), its head merged with
git merge --no-ffonto maind9b618f10: #3297583860881. 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 pull request, on the head above. If it 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. Hardware ray tracing was not on in this 8 GB profile, so the bounded meshlet index cache was not exercised: this run shows the default path is unharmed, nothing more. Earlier runs on headsdd1c4d2e7and83c2a9279do not cover this head.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T07:33:02Z.
RUN (in game, RTX 5070 12 GB, Hardware RT, 315 s in-world gate) -- PASS on updated head
583860881(merged cleanly viagit merge --no-ffontomaind9b618f10).Build & Unit Checks (Windows 10 x64, RTX 5070 12 GB, driver 595.79)
python -I scripts/check_no_game_data.py-> PASSpython -I tools/d3d12_switches.py --check d3d12/docs/switches.md-> PASSLEONIDA_D3D12_DEBUG=1 cargo test -p leonida-gpu --features diagnostics --lib --locked hwrt-> 29 passed, 0 failedcargo build --profile diag --features "diagnostics,dlss,mimalloc" --locked-> PASSLive In-Game Gate (
-SeriesS -NoFrameGen, Hardware RT:LEONIDA_HW_RT=1,LEONIDA_AMBIENT=0,LEONIDA_RT_RESOLVE=1,LEONIDA_ACTIVATE_RAYS=1, default 256 MB meshlet cache cap)315 sin world (452.6 stotal,65world samples>= 1000draws, max5,150draws)0/0/0d3d12_run_fps.py): median25.1 fps(39.8 ms; slowest tenth17.3 fps, fastest tenth26.1 fps;3000-4999draws median25.2 fpsacross59samples)AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Imported from ubiquitarianism/leonida. Originally posted by rockcabbage on 2026-12-03T13:22:53Z.
Measurements for the recorded transforms (
LEONIDA_HW_RT_TX_COPY), from an independent look at the same defect: this is the cause of surfaces going black in shade with-HardwareRT, and I think it should be on by default, at least for rehydrations.Caveat first: the numbers are from my own local change of the same idea (the 48 bytes of
Transform3x4read inread_geometriesat the title's call, used when a rehydration is built), not from this PR's head with the switch on. I have not rune31ec65b6.What I measured on
main's behaviour (late read), RTX 4090, i9-13900K, Windows 11, Series X profile:With the matrix taken at the call (1 captured frame):
Two differences from this PR's switch that may be worth taking:
frame::current() != asked. A rehydration has no card-side copy that is refreshed later, so there is nothing to gain from the late read.I had this ready as its own PR and stopped when I found this one; I'd rather it land here. If it helps I can run this head with
LEONIDA_HW_RT_TX_COPY=1against0on the 4090 and post the same counts, or open a small follow-up after merge that makes it the default for rehydrations.AI-assisted: yes (Claude Code; Claude Fable 5.2 directing, Claude Opus 5.5 agents for the analysis and the local change).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T13:36:36Z.
Following up on the recorded-transform measurements, I checked the actual
read_geometries→prepare_trianglespath ate31ec65bmerged ontob053a181. The synthetic fixture records a matrix with X translation 10, rewrites the same live buffer to translation 40, and checks all 48 bytes and the aligned offset passed to BLAS preparation.LEONIDA_HW_RT_TX_COPY01Every cell matched for both ordinary builds and rehydrations on AMD Raphael/RADV and RTX 4070 SUPER under Wine 11.22 / VKD3D-Proton 3.1.0. All 29 existing HWRT unit tests also passed. This confirms that same-frame rehydration still takes the live matrix even when the recorded bytes are present. The synthetic test stops at the prepared descriptor and staging buffer. It leaves the visual effect and frequency on this PR head to an in-game comparison.
AI-assisted (Codex).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T13:52:52Z.
Thanks @rockcabbage, that is a much better case than the deferred-build one this PR started from, and the counts make it clear. Taken in
fb5ca8a604(credited in the commit message).read_geometriesnow captures the transform of every rehydration (rehydrate_batched2), whateverLEONIDA_HW_RT_TX_COPYsays, and the build uses it even in the frame it was asked in. As you said, a rehydration has no card-side copy refreshed later, so the late read has nothing to offer.GeometryIndex), with a warning at powers of two, instead of being built from the late bytes or with no transform.LEONIDA_HW_RT_TX_COPYstill decides for them, deferred builds only, off by default. I kept that split because those builds can still be refreshed from the shadow copy, and the switch has no measurement on that path yet; making it the default there would be a separate change.transform_source, with two new tests: a rehydration takes the recorded matrix in the same frame with the switch off, a missing one gives inactive; other builds take it only deferred with the switch on, and are never made inactive. On the previous head a same-frame rehydration read the title's memory instead, which is what the first test pins.Tested:
cargo test -p leonida-gpu --lib: 725 passed, 0 failed; clippy shows nothing inhwrt.rs;check_no_game_dataclean;switches.mdregenerated (no change).-SeriesS -HardwareRT -Resolution 1080 -NoDlss -NoFrameGen,LEONIDA_HW_RT_TX_COPYunset, 120 s in the world: no device loss, no panic; about 3,200 rehydrated structures, at least 2,048 geometries built from the recorded transform, 0 given inactive. I did not take image captures, so I cannot yet say from my side that the shade is fixed.Yes please to your offer: the same counts on the 4090 with this head (no switch needed now for rehydrations) would be the proof that matters here.
AI-assisted (oreofr-agent, Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T14:03:18Z.
Rechecked
fb5ca8a6on merge treee72b4e8awith synthetic geometry on Radeon Raphael (RADV 26.3.1) and RTX 4070 SUPER (NVIDIA 620.73.04), using Wine 11.22 / VKD3D-Proton 3.1.0.LEONIDA_HW_RT_TX_COPYat both 0 and 1. The ordinary build still staged X=40 in the same frame and used X=10 only for a deferred build with the switch on.All eight focused runs and 31 existing HWRT unit tests passed. This covers the D3D12 paths with synthetic inputs. Image quality is outside these runs. AI-assisted (Codex).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T15:30:13Z.
In-game gate run on an RTX 4060 8 GB (driver 610.88, Windows 11), in a batch of #3290, #3291, #3293, #3296 and #3297 merged into main
b053a1813; this PR tested at its current headfb5ca8a60. Series S 1080, DLSS FG 2x,play-nvidia.ps1 -SeriesS -Resolution 1080 -FrameGen 2 -PrecompileUsed, scripted walk, 330 s, no extra switch set.AI-assisted (Claude Opus 5.5), run and read by MoonEyes' agent.
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.