d3d12: a bound on each texture sweep, opt-in (D3D12-SWEEP-BOUND) #3296
Open
OreoFR wants to merge 6 commits from
upstream-pr/3296 into main
pull from: upstream-pr/3296
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!3296
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3296"
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:17:42Z.
Item: D3D12-SWEEP-BOUND (claimed in #2570). Ported from tomk134's local branch (github.com/tomk134/mandy,
local/2026-12-03, 844265408; GPL-3.0-or-later, as this tree).What and why
When the card is short of room, the keep rule asks
let_go_idleto let go of everything over its line in one look, on the submitting thread. tomk134's notes measured one such look letting go of over a gigabyte of host copies, a 2.4 s freeze, when Windows cut the card's budget from 15.2 to 14.3 GB. That figure is their measurement, not ours.LEONIDA_SWEEP_MB=<MB>(off by default) bounds one look:Only the bound and the 4 ms stop are ported, made opt-in. tomk134's branch has 256 MB on by default; their other sweep changes, such as
LEONIDA_STALE_SWEEP, are not part of this PR. The logic sits in two small pure functions,sweep_boundandsweep_time_up, used inlet_go_idle.Tested
a_sweep_bound_caps_a_look_only_when_set_and_room_is_asked:mostis unchanged;mostis capped, and doubled at 1.5 s or less;a_bounded_look_stops_after_4_ms_and_only_then:cargo test -q -p leonida-gpu: 718 passed, 59 ignored.cargo clippy -p leonida-gpu --all-targets -- -D warnings: clean.d3d12/docs/switches.mdregenerated, and--checkpasses.check_no_game_dataon the changed files: OK.Needs: an in-game A/B with the switch, ideally on a card that gets its budget cut or sweeps large amounts while driving. Count the frames over 1 s and the sweep time in the log's trail, with
LEONIDA_SWEEP_MB=256against unset. Not run here; the GPU was reserved for other A/Bs.AI-assisted (oreofr-agent).
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T05:22:05Z.
Review: COMMENTED
Reviewed
efecc7f6ond9b618f10. The Windows MSVC build passed, and the resource test binary reported 29 passes under Wine, including both new pure tests. The switch catalog check and all 20 catalog tests passed.[P2] Read the clock only at enabled checkpoints.
resource.rs:2760evaluatesbegan.elapsed()beforesweep_time_upcan check the cap, pressure, or candidate index. In a CPU fixture using the exact call and 8,192 candidates, this makes 8,192 timer reads with the cap unset, 8,192 with no pressure, and 8,192 when bounded. The lazy version makes 0, 0, and 32. Pass a lazy elapsed provider or check those conditions before reading the clock so the default path keeps its existing cost.[P2] Include candidate preparation in the timing budget or describe it as a release-loop budget. The full
allscan andby_age.sort_unstable()at lines 2718–2729 run before the clock begins at line 2747. The trail’s timing also excludes that work, and the subsequent commit-floor pass can retire additional copies outside the new cap. A single whole texture can cross the byte threshold. Please document the soft limit and emergency pass, and time the full submitting-thread sweep for the requested A/B so a longer candidate scan remains visible.The verification above used synthetic inputs and did not measure live GPU stalls. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T05:28:55Z.
The Linux job failed the 4× timing assertion in
tests/test_instance_lists.py. It measured 20.9 ms for the bulk path and 63.4 ms for the record-by-record oracle. That test andtools/instance_lists.pyare byte-identical betweend9b618f10andefecc7f6. Ond9b618f10the targeted test passed in five local runs and the full 21-test file passed. I reproduced a wall-clock failure by adding a synthetic wait around the fast path. I’ll track the timing fixture separately. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T05:33:49Z.
Thanks @merzleckeier, fixed in
9b4c1ab5a:sweep_time_upnow takes a closure, which is read only when the bound is on, room is asked and the look is a 256th. A new test,the_clock_is_read_only_at_enabled_checkpoints, counts the reads over 8192 candidates: 0 with the bound unset, 0 with no room asked, 32 when bounded.cargo test -p leonida-gpu: 719 passed. Clippy: clean. (oreofr-agent, AI-assisted)Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T05:37:35Z.
Rechecked
9b4c1ab5merged ontod9b618f10. The exact loop call with a zero-based 8,192-candidate fixture now reads the clock 0, 0, and 32 times in the unset, no-pressure, and bounded cases. Reintroducing eager evaluation makes the fixture fail at 8,192 reads with the cap unset. The Windows MSVC resource test binary reported 30 passes under Wine, including all three sweep tests, and all 20 catalog tests passed. This resolves the per-candidate clock finding.The other review point remains: the clock still starts after candidate collection and sorting, and the reported
SWEPT_USomits those steps. The requested A/B should measure the whole sweep, including preparation. Synthetic checks only. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T05:44:03Z.
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:16Z.
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 lixonik on 2026-12-03T06:09:13Z.
RUN (in game, RTX 5070 12 GB, 315 s in-world gate) -- PASS on head
9b4c1ab5a(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-> PASScargo test -p leonida-gpu --lib --locked resource::-> 32 passed, 0 failedcargo build --profile diag --features "diagnostics,dlss,mimalloc" --locked-> PASSLive In-Game Gate (
-SeriesS -NoFrameGen,LEONIDA_SWEEP_MB=64enabled)9b4c1ab5aond9b618f10,LEONIDA_SWEEP_MB=64)315 s(449.4 s)65(5,964)0/027.0 fps(37.1 ms)22.4/28.2main(d9b618f10, same profile)315 s(430.8 s)64(7,828)0/027.0 fps(37.1 ms)20.2/27.9leonida_gpu::resource: texture sweeps let go of at most this much a look when room is asked (LEONIDA_SWEEP_MB) mb=64confirmed active in the live log;0errors and clean pacing throughout the 315 s run.AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T06:14:59Z.
RUN (in game, one pull request), its head merged with
git merge --no-ffonto maind9b618f10: #32969b4c1ab5a. 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. Its bound on texture sweeps is opt-in and was left off, so this run covers the default path only. An earlier run on headefecc7f60is not reported: the head moved during it.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T06:15:13Z.
I ran a synthetic timing check on
9b4c1ab5to follow up on the candidate-preparation finding. The fixture calls the actuallet_go_idlewith generated 1×1 texture descriptors, randomized idle ages, a forced pressure policy, and no resident copies to retire. I added separate timing for candidate scanning/sorting and read theSWEPT_USdelta. This was an optimized Windows MSVC diagnostics build on Ryzen 7 7800X3D / AMD Raphael, Wine 11.22 and VKD3D-Proton 3.1.Medians of 10 measured calls with
LEONIDA_SWEEP_MB=64, in ms:SWEPT_USWith the cap disabled, the 200,000-candidate median was 12.77 ms end to end and 5.32 ms in
SWEPT_US. The cap cuts the candidate release loop, while the ranked scan already present in both cases can exceed 4 ms by itself. These are preparation/control timings with synthetic resources. The reported 315 s RTX 5070 run covers in-game stability. For the stall comparison, measuring the whole sweep and recording which calls actually entered pressure would make the results comparable. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T06:52:49Z.
Thanks @merzleckeier, fixed in
9c1e4ebe2.SWEPT_UScover the whole look.SWEPT_BOUNDEDcounts the looks that ran bounded under pressure and the ones the 4 ms check stopped, and they are printed beside the sweep stats, so an A/B can tell those calls apart.cargo test -p leonida-gpu: 721 passed. Clippy: clean. With the clock moved back after the sort, the test fails.(oreofr-agent, AI-assisted)
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T07:08:51Z.
Review: CHANGES_REQUESTED
[P2] Guarantee progress when ranking spends the entire time budget. At
9c1e4ebe, the clock andSWEPT_USnow include gathering and sorting. The first deadline check occurs after that work, before candidate zero is examined. When gathering and sorting consistently take over 4 ms, each sweep repeats the same work and releases nothing, even when the oldest candidates have idle, uniquely held copies.I reran
let_go_idleond9b618f1plus9c1e4ebein a Windows MSVC build under Wine 11.22 on Ryzen 7 7800X3D / AMD Raphael. The fixture ranks 16 real 1×1 host textures ahead of the other synthetic candidates and checks that each copy has one owner before every run. Forced texture-budget pressure was the same in both controls.LEONIDA_SWEEP_MBAt 200,000 with the cap on, the loop inspected zero candidates in every measured call. If the time limit should cover the whole sweep, candidate preparation needs a resumable bound as well. If the intent is a release-loop budget, starting that budget after preparation gives releases a chance to make progress while keeping the wider
SWEPT_UStiming for diagnosis.All 32 targeted resource tests passed, including the two new tests. The synthetic timing and release counts use no game files. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T07:31:23Z.
RUN (in game, one pull request), its head merged with
git merge --no-ffonto maind9b618f10: #32969c1e4ebe2. 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. Its bound on texture sweeps is opt-in and was left off, so this run covers the default path only. Earlier runs on headsefecc7f60and9b4c1ab5ado not cover this head.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T07:33:03Z.
RUN (in game, RTX 5070 12 GB, 315 s in-world gate) -- PASS on updated head
9c1e4ebe2(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-> PASScargo test -p leonida-gpu --lib --locked resource::-> 34 passed, 0 failedcargo build --profile diag --features "diagnostics,dlss,mimalloc" --locked-> PASSLive In-Game Gate (
-SeriesS -NoFrameGen,LEONIDA_SWEEP_MB=64enabled)9c1e4ebe2ond9b618f10,LEONIDA_SWEEP_MB=64)315 s(451.7 s)64(5,292)0/026.7 fps(37.5 ms)21.2/27.8main(d9b618f10, same profile)315 s(430.8 s)64(7,828)0/027.0 fps(37.1 ms)20.2/27.9AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T07:36:28Z.
Thanks @merzleckeier, fixed in
d8ed371ba, following your release-loop suggestion. The 4 ms bound now reads the release loop's own clock, started after the gathering and ranking, and it never stops a look at its first candidate. A slow ranking can no longer use up the look: each bounded look releases up to its first 256 candidates.SWEPT_USstill times the whole look, preparation included. New checks: the deadline never fires at candidate zero, and a source-order test confirms that the release clock starts after the ranking and is the one the deadline reads.cargo test -p leonida-gpu: 721 passed. Clippy: clean. (oreofr-agent, AI-assisted)Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T07:46:10Z.
Rechecked
d8ed371bonmaind9b618f1with the same synthetic AMD Raphael fixture andLEONIDA_SWEEP_MB=64. At 200,000 ranked textures, the previous revision visited zero candidates and freed zero copies in all ten measured looks. The new revision freed all 16 copies in all ten looks when they ranked first. All 32resource::testspassed in the Windows MSVC build under Wine 11.22.A bounded look can still spend its release time on entries whose host copies are already gone.
Hosted::takeclearsmade_base, but leavesusedintact, so entries with an old use and no copy can still outrank a reclaimable texture. I placed the same 16 real 1×1 host copies last behind older entries with no copy. The bounded loop stopped before reaching any of them in 7/10 looks. The unbounded control released 16/16 in every look.A scratch control skipped entries with
made_base.load(Acquire) == NO_COPYwhile gathering the bounded list, keeping the locked checks inlet_go_of. With the cap still at 64 MiB it inspected and released exactly 16 in all ten late-ranked looks. Whole-look time for that fixture went from 11.18–12.16 ms to 0.33–0.50 ms. This control uses synthetic pressure. Please also update the two comments bybeganandthe_sweep_clock_starts_before_the_rankingthat still describe the 4 ms limit as covering preparation. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T07:54:25Z.
RUN (in game, RTX 5070 12 GB, 315 s in-world gate) -- PASS on updated head
d8ed371ba(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-> PASScargo test -p leonida-gpu --lib --locked resource::-> 34 passed, 0 failedcargo build --profile diag --features "diagnostics,dlss,mimalloc" --locked-> PASSLive In-Game Gate (
-SeriesS -NoFrameGen,LEONIDA_SWEEP_MB=64enabled)d8ed371baond9b618f10,LEONIDA_SWEEP_MB=64)315 s(432.8 s)64(5,258)0/027.5 fps(36.4 ms)21.6/28.3main(d9b618f10, same profile)315 s(430.8 s)64(7,828)0/027.0 fps(37.1 ms)20.2/27.9AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T12:16:18Z.
Current-head follow-up on
e85278f4merged withb053a181. I added a held-copy control to the synthetic AMD RADV / Wine test. There were 200,000 ranked entries, with 15 releasable copies and one copy held by another reference. AtLEONIDA_SWEEP_MB=64the current PR released the 15 copies in 4 of 20 measured sweeps. The other 16 sweeps stopped before reaching any of them.Filtering
made_base == NO_COPYduring bounded candidate gathering, withlet_go_ofstill checking under the lock, released all 15 in 10 of 10 sweeps. The held copy kept the same identity throughout. Both builds released all 15 with the cap disabled. The filtered build also passed 37 resource tests and the idle-ranking test. These measurements use synthetic D3D12 resources and simulated texture-budget pressure.AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T12:46:21Z.
Thanks, good catch. Fixed in
faf157dc16, following your suggestion.let_go_idlenow ranks only textures that have a host copy to let go (made_base != NO_COPY). The check is the newranked_for_release(used, fills, made_base, idle), which asks the idle time last. A texture without a copy frees nothing, but ranked among the oldest it used up the look before any copy was reached.let_go_ofstill decides under the lock, so a copy held by another reference stays.a_bounded_look_reaches_the_copies_behind_textures_without_one:made_baseclause removed it fails, because 0 copies are reached;leonida-gpulib tests: 722 passed. Clippy (-D warnings) reports nothing on the changed lines.check_no_game_datapasses.AI-assisted (oreofr-agent).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T15:30:12Z.
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 headfaf157dc1. 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.
Imported from ubiquitarianism/leonida. Originally posted by JeezyCL on 2026-12-03T17:29:12Z.
In-game runs with the switch on and the card short of room. RTX 4070 Ti 12 GB, driver 621.35, i7-13700KF, 32 GB, Windows 11. Series S with
-HardwareRT, 0.75 scene scale, DLSS to 1080p, FG 2x.LEONIDA_SWEEP_MB=256, code offaf157dc1on an older base with local changes (see limits).Limits: normal play, one run each, with different saves and routes, so this is not an A/B, and not all of the difference is necessarily due to the switch. Both builds also gather candidates from a local list of textures that have a host copy instead of walking all of them, so gathering is probably cheaper here than in this PR alone.
AI-assisted (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.