[pr-performance] shadow,onepass,heap_twin: bound one-pass windows, open emitter lazily, LPT-sort dirty spans #218
Loading…
Reference in a new issue
No description provided.
Delete branch "hingeowl/Darner:pr/onepass-lpt-spans"
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?
Re-submitted from the previous CodeFloe repository (original PR #165, commit
0bb0d6b0db27c64153965b57ffd6fc8bc43f9559, preserving original authorship by Ethan Anderson) so it is not lost after the forge move.What it changes
[16 MiB, 32 MiB]inhost::send::onepass.ACTIVE,TOP,META) to 128 B, aligns window slices to 64 B (WC_ALIGN), and reuses thread-local scratch buffers across emits.onepass::slot_epoch) and opens the emitter lazily inShadow::take_intoonly on the first changed page.largest_firstwith descending LPT sorting for dirty spans inBatch::refresh_front_spans.!used.load(Relaxed)beforeSeqCststore inheap_twin::note_used.Notes
main(f3840d7).mainhas not been run yet.CHANGES NEEDED
Review of
252ae44fd.Both strict Clippy gates fail on the new
unnecessary_sort_bywarnings incrates/darner-gpu/src/host.rs:17106and:17111. Replace the comparator sorts with the suggestedsort_unstable_by_keyforms (usingReverse) so the workspace gates pass.Windows validation: G1 FAIL; G2 FAIL (the two Clippy warnings above);
cargo xtask policyPASS (555 files ok);heap_twintests — 9 passed, 0 failed;onepasstests — 8 passed, 0 failed.Not run in-game.
AI-assisted: yes (GitHub Copilot, Auto mode).
Replay A/B on RTX 5070 Ti: no measurable difference
Measured
252ae44fdemerged on top of release v2026.12.03.02, against the plain release, on a ~6.5 minute replay route (same save, recorded controller input) through a cutscene, a scene cut and a stretch of free play.Crashes: none in any run (no device loss, no host GPU failure). Fps means are within the release's own run-to-run spread, so: no measurable difference on this route. With only 3 release runs, that spread is not well known yet; differences under ~2-3% can't be resolved here.
Config: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB RAM, Windows 11;
scripts\play-nvidia.ps1 -Build release(Series X, 1440p native, DLSS Quality, no frame generation, fullscreen, no fps cap). Each build had one unmeasured warm-up run first. The release base excludes its first measured run, which was still compiling shaders (about 3,300 compiles during the route).Measured unattended on a replay bench (same save, recorded controller input); numbers and text prepared with Claude.
Fixed in
e4dafb3: replaced both comparator sorts incrates/darner-gpu/src/host.rs(:17106and:17111) withsort_unstable_by_key+std::cmp::Reverse.Validation on
e4dafb3:cargo clippy -p darner-gpu --all-targets --all-features --locked -- -D warnings— passed.Ready for re-review.
cam-cityABBA Benchmark on RTX 4090 + 7950X3D: Consistent Regression (+8.2% Median Frame Time)Tested
e4dafb3againstmain(f3840d7) in a full ABBA sequence (A1 -> B1 -> B2 -> A2) on the full 172 scam-cityroute usingbench-kit(with thefoot.pypinsfix update), after warming pipelines onmain.Per-Run Results (
all tagged rows, ~176 s)prep_ms(med)card_idle_ms(med)card_lists_ms(med)pipe_mademain(f3840d7)e4dafb3)e4dafb3)main(f3840d7)mainSegment Breakdown (Median Frame Time)
112.26, 113.37 ms(mean112.82 ms) → B =117.92, 109.91 ms(mean113.92 ms, +1.0%)83.37, 85.38 ms(mean84.38 ms) → B =91.15, 83.19 ms(mean87.17 ms, +3.3%)Summary
cam-city: both PR #218 runs (99.73, 100.31 msmedian) landed outsidemain's A1–A2 spread (90.54, 94.33 ms), with overall FPS down -6.8%, p95 up +7.0%,prep_msup +4.2%, and frames >100 ms rising from 39.7% to 50.0%.B1had near-zeropipe_wait_ms(9 ms) and still matchedB2at99.73 msmedian, so the slowdown is not attributable to pipeline compilation.cam-bench.pyclean checks (RESULT: camera route flown, clean) with zero crashes or device losses.Environment
621.14), AMD Ryzen 9 7950X3D, Windows 11 Pro (build26300).cargo build --release --locked -p darner --features bench-remote.bench-kit(pinsfixfoot.py),cam-city(172 s), Series X profile, HW RT enabled (DARNER_HW_RT=1,DARNER_BVH_BUILDER=1),play.rsDEFAULT_ENVtuning, no frame generation.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.