d3d12: separate upload VA from BVH arenas so DLSS FG runs with ray tracing (D3D12-RT-FG-ARENA-VA-STORM) #2643
Open
zmasi wants to merge 10 commits from
upstream-pr/2643 into main
pull from: upstream-pr/2643
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!2643
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2643"
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-11-29T20:43:03Z.
Claimed in #2570:
D3D12-RT-FG-ARENA-VA-STORM(https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7250446579)Summary
Fixes
D3D12-RT-FG-ARENA-VA-STORMacrossd3d12/crates/leonida-gpu/src/{upload.rs, memory.rs, fg.rs, lib.rs},d3d12/crates/leonida-hle/src/lib.rs, andd3d12/apps/leonida/src/main.rs(head9f39297d6a):[4 GiB, (MEMORY_PAGES - 1) * 64 KiB)) from host-only arena VA ([2^37, 2^40)) and reserve low upload space at startup:upload::reserveplaced both shader-addressed command-list upload blocks (Upload::new, whose CPU pointers are passed to shaders as 40-bit GPU addresses and indexed in the2^21-pageMEMORY_PAGESdirectory) andMemory's own CPU-side directory and 64 MiB BVH page arenas (memory.rs, which no shader ever addresses by CPU pointer) inside[4 GiB, 2^37)with nothing reserved ahead at process startup.fg::present_start), low-VA reservations alongsidexmemtitle mappings exhausted contiguous 64 MiB holes in[4 GiB, 2^37)(kept alive across toggles byDLSSGFlags::eRetainResourcesWhenOff).upload::reserve_space(wired vialeonida_hle::reserve_upload_space()right after logging init inapps/leonida/src/main.rs) now pre-reserves top-down write-watched address space (POOL_PIECES, uncommitted until sliced, bounded strictly below the emptyMEMORY_PAGES - 1clamp sentinel at0x1f_ffff_0000) forUpload::new(with 1-second failed-window scan backoff, non-destructivecommit_pool_slice, and overflow-checkedUpload::from_heapfallback), whileupload::reserve_out_of_reachplacesMemory's directory and 64 MiB arenas in[2^37, 2^40)first (with overflow-safeLEONIDA_LOW_EARLY_MBearly 64 MiB write-watched reservations andcommit_early_pieceretry). Adapted with credit from GPL-3.0 upstream commits inKemerd/VIctory-NVIDIA-RT(cbe02a6f9c,3e7e69cccf,1527faeac4) andtrustno1-coder/VIctory-NVIDIA(30b979ee48,e69e39c55b,0dd6ed89f7).VirtualAlloc2arena storm and 64 MiB VA leak inMemory::anotherandMemory::new:memory::readyandMemory::mapcalledMemory::another()->VirtualAlloc2under the globalMEMORYmutex on every BVH builder and ray-tracing dispatch (thousands of kernel VAD scans per frame, collapsing recording to~0.1 FPSwhile unmapped BVH pages stayed0indirectoryand blew ray-resolve passes out to white), andMemory::another/Memory::newleaked reservations whenshadow::by_addressorMemory::numberreturnedNone.Memory::another(another_from+ sharednumber_intoover disjoint struct field borrows) now memoizesfailed_arena_frameso a frame tries at most once and retries on the next frame, and bothMemory::anotherandMemory::newrelease reservations viaupload::releasewhenever host-copy creation or numbering fails.fg::wanted:wanted_forsoLEONIDA_FRAME_GENstarts withLEONIDA_BVH_BUILDER=1by default while preservingLEONIDA_FG_WITH_RT=0as an explicit opt-out.Verification
origin/main):[4 GiB, 2^37)reproduced both the multi-second Windows 11 kernelVirtualAlloc2scan stall across repeatedMEM_ADDRESS_REQUIREMENTSqueries andNonefailures for 64 MiBMemoryarenas;Memory::anotherhad no per-frame backoff and leakedatwhenshadow::by_address/numberreturnedNone;fg::wanted()returned0wheneverLEONIDA_BVH_BUILDER=1withoutLEONIDA_FG_WITH_RT=1.cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib upload::tests -- --test-threads=4->7/7passed ([2^37, 2^40)write-watch tracking +VirtualQueryMEM_FREErelease,[4 GiB, (MEMORY_PAGES - 1) * 64 KiB)POOL&MEM_TOP_DOWNsentinel-bound +Memory::mappable_pageproof, commit-failure retry, window backoff, overflow/heap fallback).cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib memory::tests -- --test-threads=4(default and--features diagnostics) ->4/4passed (2,048-dispatch per-frame storm backoff =1call,MEM_FREEverification on failed host copy, live D3D12shadow::by_addressUAV buffer above2^37).cargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib fg:: -- --test-threads=4->3/3passed (wanted_tests,limit_tests,reflex_frame_tests).cargo test --manifest-path d3d12/Cargo.toml -p leonida-hle --lib tests::(210/210) &cargo test --manifest-path d3d12/Cargo.toml -p leonida --bin leonida(36/36) -> passed.cargo clippy --manifest-path d3d12/Cargo.toml -p leonida-gpu -p leonida-hle -p leonida --tests&--features diagnostics->0warnings in modified files.python -I scripts/check_no_game_data.py->0issues, pure LF.GPUs tested: NVIDIA GeForce RTX 3090 (Windows 11, driver 610.88)
AI-assisted: yes
Checklist
mainand merges cleanly.CONTRIBUTING.md), including in logs or reports quoted here.docs/design.md, with how it was confirmed. (n/a: D3D12 runtime memory/FG management only)Imported from ubiquitarianism/leonida. Originally posted by ammonium231 on 2026-11-30T05:59:52Z.
RTX 3090 / 621.40, validation on,
9f39297d6merged onto main1d22590b9: upload::tests 7, memory::tests 4, fg:: 10 pass (main 2/2/9), no validation errors. Unit tests only; the in-title DLSS FG + RT path isn't exercised.Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T10:46:52Z.
RUN (independent run, #2643 head
9f39297d6on maine1fe82f63; merged locally withgit merge --no-ff, no conflicts; also no conflict with #2566 head70ea7d6ecpergit merge-tree --write-tree). Main has since moved to012b79a67, which changes onlyd3d12/docs/findings.mdandd3d12/scripts/play-nvidia.ps1, so the crates tested are the same. It still merges cleanly there.Commands, in
d3d12/, target x86_64-pc-windows-msvc, toolchain 1.98.1, all with--locked:cargo test -p leonida-gpu --no-fail-fast: green, 567 passed / 0 failed / 50 ignored. Main gives 559 / 0 / 50, so the 8 new tests all pass and the ignored ones are the same.cargo test -p leonida-hle: 220 / 0 / 2.cargo test -p leonida(the app): 43 / 0 / 0. Both are the same as on main.cargo clippy -p leonida-gpu -p leonida-hle -p leonida --all-targets(without-D warnings, which already fails on main in leonida-shader and leonida-lua), on main and on the merge: no new warning in the six files the PR touches (9 already there on main, the same 9 on the merge).another_from,wanted_for,reserve_out_of_reach,release,commit_pool_sliceand others not found). That alone proves little, so I also ran the behavioural reds below.cargo test -p leonida-gpu --lib -- memory::tests upload::tests fg::wanted_tests. These 12 tests all pass in the full run above, without a mutant:another_from:failed_arena_backs_off_for_the_frame_and_releases_unnumbered_reservationsfails, with 2,048 reservation attempts instead of 1.release(at)removed after a failed copy: the same test fails later on. The reservation is still committed (state 0x1000, notMEM_FREE).wanted_forput back to main's rule (off with ray tracing unlessLEONIDA_FG_WITH_RT=1):frame_generation_starts_with_ray_tracing_unless_explicitly_disabledfails (0 for 1).reserve_out_of_reachwithout its [2^37, 2^40) step:out_of_reach_places_write_watched_memory_above_37_bits_and_releases_cleanlyandby_address_shadow_works_on_out_of_reach_reservationfail, both getting an address in [4 GiB, 2^37).window_allows_atdisabled:window_backoff_suppresses_repeated_scans_until_expiryfails.A default change to note: in
fg.rs, frame generation now starts withLEONIDA_BVH_BUILDER=1unlessLEONIDA_FG_WITH_RT=0. Main left it off there because the two together ran at 0.1 frames a second.scripts/play-nvidia.ps1is not changed, and on current main it still removesLEONIDA_FRAME_GEN(and FSR 3 frame generation) when ray tracing is on, unlessLEONIDA_FG_WITH_RT=1. So through the launcher, frame generation with ray tracing stays off, and the new default only applies to starts without the launcher.Perf: this needs an in-game A/B with ray tracing on.
d3d12/README.mdsays DLSS frame generation runs on RTX 40 and 50 cards only, so its frame-generation half cannot be run on an RTX 3090 (the PR lists a 3090 as the tested GPU). The arena and stall half can be (ray tracing on, frame generation off).No runtime/ C++ or Python in this PR, so no link or import check applies.
Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T16:36:22Z.
Independent check on Windows (not the author), at
9f39297d6.cargo test --locked -p leonida-gpu --lib(shared warm target): 540 passed, 0 failed, 46 ignored in 13.7 s.The diff is source-only (
main.rs,fg.rs,lib.rs), so this is compile + regression coverage. The DLSS-FG-with-ray-tracing behaviour itself needs a game run, which I did not do.Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, NVIDIA RTX 4070 Ti SUPER (driver 621.01), Rust 1.98.1 pinned.
AI-assisted: yes (opencode).
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-01T03:25:32Z.
Independent game-run A/B test on Windows 10 + NVIDIA RTX 5070 12 GB (driver 621.40) with DLSS Frame Generation 2x + Ray Tracing enabled (
MEASURED, n=1 control / n=2 PR runs;d3d12/target/diagbuilt withdiagnostics,dlss,mimalloc, DLSS v310.9.16, Streamline v2.14.16).Verdict:
better(reproduces themain0.2 fps / 13-arena collapse and fixes it cleanly in both PR runs:5,391.0 ms->101.8 / 104.0 ms,0.2 -> 8.7 / 8.9 fpsin the3000-4999draw bucket, 20 arenas / ~1,157-1,187 MB allocated, 0 runtime errors, 0 device losses).One small launcher note (
READ IN CODE,d3d12/scripts/play-nvidia.ps1:519):play-nvidia.ps1still stripsLEONIDA_FRAME_GENwhen-RayTracingis passed unless-More @{LEONIDA_FG_WITH_RT='1'}is supplied, so both arms below passedLEONIDA_FG_WITH_RT=1explicitly (updatingplay-nvidia.ps1can be done here or in a follow-up). Also note: in unattended runs Streamline reportedtagged=true status=0withpresented=1 per=1on the periodic state snapshot alongside Reflex latency reports; interactive foreground focus was not manually tested for interpolation cadence, while the low-VA exhaustion and 5.4 s/frame collapse are completely resolved.Summary via
tools/d3d12_run_fps.py --compare(A vs B1):3000-4999draws: A0.2 fps (6)vs B18.7 fps (10)(+5700%), B28.9 fps (8)5000-6999draws: A0.2 fps (2)vs B110.4 fps (2)AI-assisted: Antigravity.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T13:07:10Z.
Required an actual GPU backing for the out-of-window reservation with
2cea6871c+ed867d7b2. I changed the optionalby_address_shadow_works_on_out_of_reach_reservationassertion locally to require a hardware D3D12 device and a successful backing allocation. The 128 KiB fixture created the backing and passed span and GPU-offset checks on AMD RADV 26.3.1 and RTX 4070 SUPER (620.73.4), under Wine 11.22 and vkd3d-proton 3.1.0. The upload, memory and frame-generation helper filters passed 7, 4 and 10 tests respectively on each device. These tests cover the reservation and backing path. DLSS Frame Generation with ray tracing in-game was outside this run.AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T23:48:40Z.
RUN (provisional, n=1 per arm) of head
2cea6871cmerged onto main913b88b90(tree 940650739), against main913b88b90as control. RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11, launcher-SeriesS -RayTracingwith DLSS and frame generation left at their defaults, BAR 0, texture budget 1024, 330 s walking run each, the pull request first and main second.AI-assisted: Claude Code (oreofr-agent).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:23:44Z.
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T13:54:24Z.
Ran natively on Windows 11, head
2cea6871cmerged into currentmain(128648cfe, no conflicts),leonida-gpuwith--features diagnostics,--locked, toolchain 1.98.1. I ran the tests on the hardware card and again on WARP, with the same results.Earlier runs covered the PR's own tests, mutants and in-game runs. This run checks whether the split between the upload pool, the early pieces and the out-of-reach arenas can give out the same address twice or send a lookup to the wrong buffer.
Suite
cargo test -p leonida-gpu --lib(merge)memory::tests upload::tests fg::cargo clippy -p leonida-gpu --all-targetsmemory.rs,upload.rs,fg.rsorlib.rsAllocator probes (throwaway tests in
upload.rs, not committed)Upload::neweach (100 B to 9 MiB, sizes chosen so some need a new arena), plus 32reserve_out_of_reachof 4 or 64 MiBLOW_END), every out-of-reach block in [2^37, 2^40)LEONIDA_BVH_BUILDER=1: 8 threads × 10reserve_out_of_reach(64 MiB)commit_pool_sliceon a 3-piece fake pool, 5,000 random sizes from 1 B to 64 MiB + 1POOLmarked full, thenreserve(4 MiB)0x1_0000_0000, belowLOW_ENDand clear of all 32 pool pieces (0x1f7fff0000up toLOW_END)Upload::new(4 MiB)back to back...bff0000,...c3f0000), andshadow::extentat each start and each last byte resolves to its own bufferI found no overlap and no address given twice, and
shadow::extentresolves both ends of two adjacent arenas to their own buffers.Two behaviour changes, read in code, not tested in game:
Upload::newnow returns process-heap memory (above 2^40) wheremainreturnedNone. Soallocate_upload(list 0x4a0, the title's BVH instance descriptions) now gets a pointer that shaders read as zeros, wheremaingave a null pointer. The PR logs this once.reserve_upload_space()runs at startup whateverLEONIDA_UPLOAD_LOWsays. SoLEONIDA_UPLOAD_LOW=0("from the process heap, as before") still reserves the 32 × 64 MiB of address space, though it commits none of it.Not checked: DLSS frame generation together with ray tracing in game. How much room the low window has after Streamline/NGX/CUDA have loaded.
shadow::lookup, or an ask spanning two adjacent arenas.leonida-hleand the app on this merge. The same probes onmain(no comparison made).GPUs tested: one NVIDIA desktop card + WARP.
AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-02T17:07:36Z.
RUN (in game, gate-style, as asked by MoonEyes): head
2cea6871ctested in a batch with #2643 (2cea6871c), #3031 (a47b86855), #2789 (4bd128a8c) and #2661 (1b3f3dee0), all merged withgit merge --no-ffontomain23a51c494(no conflict; the only file the four share isd3d12/docs/switches.md). Built withdiagnostics,mimalloc, targetx86_64-pc-windows-msvc. RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro (build 26300).Launcher defaults, Series S settings,
-NoDlss -NoFrameGen, standing at the save; a warm-up run first (the batch changes the translator, so everything was re-translated), then one run of 420 s with the memory safety stop:Verdict: PASS for the batch (a pass covers each of the four; a failure would not have said which). Not covered here:
-RayTracing(a run with it is queued), DLSS frame generation with ray tracing (needs an RTX 40/50 card), other GPUs.AI-assisted: Claude Code (Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:13:06Z.
Checked #2643: Rust reviewed at the level of its structure, not built here (Windows-only). Merged onto current
mainthe switches registry check fails: the newLEONIDA_LOW_EARLY_MBis not ind3d12/docs/switches.md.2cea6871cbmain45dc41f95cgit merge-tree); merge basead25611b53, 884 commits behindRan (Linux, Python 3.13.18, on an export of the merge tree in its own git repository)
Same commands on
main45dc41f95calone: exit 0, 20/20 OK. The name comes from this branch:d3d12/crates/leonida-gpu/src/upload.rsreadsstd::env::var("LEONIDA_LOW_EARLY_MB"). The head's CI of 30 November was green; on today's merge the check fails, so merging as is would turnmainred. Fix: mergemain, runpython -I tools/d3d12_switches.py --out d3d12/docs/switches.md, commit.Review notes (not built)
[4 GiB, (MEMORY_PAGES - 1) * 64 KiB)) from host-only arena VA ([2^37, 2^40)), and stoppingMemory::anotherfrom callingVirtualAlloc2on every dispatch after a failed reservation, addresses the cause described (VA exhaustion and a per-dispatch reservation storm under the globalMEMORYmutex), not a symptom.d3d12/is GPL-3.0-or-later (d3d12/Cargo.toml:11), so the licences are compatible. A maintainer may still want the credited commit IDs in the commit message, not only in the description.main. The Windows checks (ghost, KelboLive, lixonik A/B, merzleckeier, OreoFR, Kal0s-design) are on this head or the earlier9f39297d6and agree.Verdict: defects. One regenerated
switches.mdon a current merge; otherwise covered by the Windows and in-game evidence already posted.AI-assisted: Claude Opus 5.5 (Claude Code), verification 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:23:35Z.
Thanks @MoonEyes — merged
origin/main(45dc41f95c), regeneratedd3d12/docs/switches.md(LEONIDA_LOW_EARLY_MB,LEONIDA_BVH_BUILDER,LEONIDA_FG_WITH_RT), and recorded the credited GPL-3.0 upstream commit IDs in commitad354791d5as well. The PR's Rust diff from2cea6871cb(covered by @enlight3d's RTX 3090 in-game batch gate and @Kal0s-design's hardware + WARP runs) is completely unchanged.Verified on
ad354791d5:python -I tools/d3d12_switches.py --check d3d12/docs/switches.md-> exit 0python -I tests/test_d3d12_switches.py->20/20OKcargo test --manifest-path d3d12/Cargo.toml -p leonida-gpu --lib upload::tests(7/7),memory::tests(4/4),fg::(17/17), pluscargo checkwith and without--features diagnostics-> green.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T23:08:30Z.
Merged current
origin/main(16243cd6eb, integrating #3154'stitle_range.rsina17a658ea9):leonida_hle::reserve_upload_space()now runs immediately afterleonida_gpu::title_range::keep()(skippingPOOLwhentitle_rangeholds[4 GiB, 2^37 - 64 KiB), while still reservingLEONIDA_LOW_EARLY_MBin[2^37, 2^40)forMemory), andupload::releasere-holds freed low-window spans intitle_rangewhile leaving[2^37, 2^40)out-of-reach reservationsMEM_FREE(11/11upload::,10/10title_range::,4/4memory::,17/17fg::,27/27xmem::, and20/20test_d3d12_switches.pypassing).Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T00:54:49Z.
In-game run (head
a17a658ea9merged --no-ff onto main81efe45669): PASS (stability), with one frame-generation observation.Setup:
Run A, this PR's case:
-SeriesS -HardwareRT -FrameGen 2 -PrecompileUsed,LEONIDA_FG_WITH_RT=1, BAR 0, texture budget 1024.81efe4566alone, same settingsLEONIDA_FG_WITH_RTset.Run B, standard gate:
-SeriesS -NoDlss -NoFrameGen -PrecompileUsed, BAR 0, texture budget 1024.AI-assisted (oreofr-agent)
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T03:28:05Z.
Merged
origin/main(516c9eaabf, including#3230and#3244) into26e7b6057estrictly to regenerated3d12/docs/switches.md(needs rebase); all six Rust files (main.rs,fg.rs,lib.rs,memory.rs,upload.rs, andleonida-hle/src/lib.rs) have byte-identical diffs againstorigin/maincompared toa17a658ea9.@OreoFR Thank you for the RTX 4070 Laptop 8 GB run report! On the
A1observation (per=1in 20 of 21 state lines despiteStreamline started with frames=2, while 1 of 21 lines inA1and 11 of 11 inA2hadper=2):wanted_for(fg.rs:67-89, cached inOnceLock), which returned the same1(2x) asmainunderLEONIDA_FG_WITH_RT=1;present_start,present_end,tag, andSTALE_RESETS(12 resetsin bothA1andA2) are untouched.A1did reachper=2, Streamline initialized and generated at least one interval before dropping back toper=1(fg.rs:1509). The most common cause ofstatus=0, tagged=true, presented=1after an active interval is the game window losing Win32 foreground focus (fg.rs:1503-1504: DLSS-G suspends generation whenever the window is unfocused); checkingstatusandtaggedonA1'sframe generation: statelines (fg.rs:1512-1520) will show whether it was unfocused pass-through (status=0, tagged=true, presented=1) vs a non-zero Streamlinestatusortagged=false.#3230now onmain,play-nvidia.ps1setsLEONIDA_FG_WITH_RT=1automatically on Series S (and Series X>= 20 GB), whilewanted_forinfg.rsaligns direct runtime launches (play-d3d12.ps1/ Linux) and still honorsLEONIDA_FG_WITH_RT=0.AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T05:47:31Z.
VERIFY-2642 y
#2643— las dos grandes, las dos sin tests nuevos, y una de ellas mejora al fusionarLas dos de zmasi, las dos de 5-6 días, y las dos con
switches.mden el diff (la marca de esta noche para «cambia lo que el jugador puede encender»):La única falla en las dos es la de la iGPU.
#2643— y este número sí dice algo724es más que los715demain, con cero tests nuevos — o sea que su base trae nueve tests quemainya no tiene o tiene distintos, y aun así la suite pasa. Lo digo porque es lo contrario de un problema: un árbol que añade pruebas respecto amainy pasa entero es un árbol que se fusionó con cuidado.El cambio: separar la VA de subida de las arenas del BVH para que DLSS FG funcione con ray tracing — 570 líneas en
upload.rs, 229 enmemory.rs. Es un cambio de reparto de memoria, y el título nombra el síntoma exacto («DLSS FG runs with ray tra…»): el jugador enciende las dos cosas y una se rompe.#2642— compilar shaders SM 5.1 con DXC en WineY esta es la más ambiciosa de las dos: 13 ficheros, y
inplace.rs/replay/play/merge.rsen el diff — no es sólo el compilador, es el camino de la grabación.Lo que verifiqué en las dos: la suite completa del crate, con la única falla conocida, y que ninguna trae test nuevo.
Lo que no: que DLSS FG y el ray tracing convivan (
#2643) ni que un shader SM 5.1 compile en Wine (#2642) — son los dos estados que el título promete y ninguno está en la suite.Y una observación sobre la cola, con las dos delante: son las dos PRs más grandes que quedan sin revisar (1 003 y 771 líneas) y las dos vienen del mismo autor con la misma etiqueta de
switches.md. Si alguien va a fusionar dos de las antiguas esta semana, estas dos cambian el comportamiento del juego más que las otras cinco juntas — y por eso son las que más necesitan una fila engpu-test-results/, que es lo único que puede decir si funcionan.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T08:57:56Z.
RUN (in game, RTX 5070 12 GB, Hardware RT + Streamline FG 2x init, 315 s in-world gate) -- PASS (stability), plus one parallel unit-test race finding
26e7b6057merged cleanly (git merge --no-ff) ontomain(d9b618f10)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 upload:: -- --test-threads=1-- 11/11 PASScargo test -p leonida-gpu --lib --locked memory::-- PASScargo test -p leonida-gpu --lib --locked fg::-- 17/17 PASS (includingframe_generation_starts_with_ray_tracing_unless_explicitly_disabled)cargo test -p leonida-hle --lib --locked-- 258 passed, 0 failed, 2 ignoredcargo build --profile diag --features "diagnostics,dlss,mimalloc" --locked-- PASScargo test):cargo test -p leonida-gpu --lib --locked upload::without--test-threads=1failed 2 of 4 times atcrates/leonida-gpu/src/upload.rs:610(release_reholds_title_range_spans_and_leaves_out_of_reach_free:assert_eq!(mbi.State, MEM_FREE)got4096(MEM_COMMIT) instead of65536(MEM_FREE)).out_of_reach_places_write_watched_memory_above_37_bits_and_releases_cleanlyruns in parallel in the same[OUT_START, OUT_END)window and can immediately claim the just-freed lowest VA betweenrelease_in(&range, out)andVirtualQuery(out, ...). Serializing theOUT_START..OUT_ENDVirtualQuerytests (or holding a test mutex across reserve/release/query) should eliminate the flake.LEONIDA_HW_RT=1,LEONIDA_AMBIENT=0,LEONIDA_RT_RESOLVE=1,LEONIDA_ACTIVATE_RAYS=1) +-FrameGen 2, 315 s in world, 498.3 s total, 63 world samples, max 5,137 draws):eWarnOutOfVRAM: 0 (only StreamlinegetRefreshRatelines after the harness closed the window at teardown)title_rangeheld126,975 MiBacross124pieces before Streamline/NGX loaded (sl.dlss_gPRODUCTION)569 MB/1,074 MBbudget,0evicted)3000-4999draws bucket: 23.8 fps (57 samples)per=1): Streamline initialized cleanly (Streamline started frames=2,amount set (1 = off) result=sl::Result::eOk (0) frames=2,status=0across all 29 state lines,tagged=truein world), butpresented=1 per=1on all state lines on this Windows 10 automated test setup (the sameper=1behavior occurred on an unrelated FG-only run on this host, so this appears host/window-state related rather than PR-specific). Also not tested in-game here: software BVH (LEONIDA_BVH_BUILDER=1) withLEONIDA_FG_WITH_RTunset.AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T11:25:35Z.
Merged
origin/main(6e97990505,#3318) into2e0b23a002to regenerated3d12/docs/switches.md(needs rebase), and serialized the four[OUT_START, OUT_END)VirtualQuerytests acrossupload::testsandmemory::testsunder#[cfg(test)]out_of_reach_test_lock()— thank you @lixonik for both the 315 s RTX 5070 Hardware RT + Streamline FG 2x gate report and catching that parallel test race! Zero non-test Rust bytes changed compared to26e7b6057e(15/15consecutive parallelupload::+memory::runs pass).AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T14:31:56Z.
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.