RFC / Benchmarks (Team Green RTX + 8-Core x86-64): +48–59% 3D FPS via Write-Watch, Lock-Trim & L0 DMA Stack (10 Patches + Tooling) #413
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 readmet3xt-lab/foxhound. Originally posted by procotos-art on 2026-12-01T23:41:31Z.
Overall End-to-End Speedup on Team Green (RTX 5080) + 8-Core x86-64
Measured end-to-end across the full stack (
patches 01..10+ verified 8-core runtime toggles) on Ryzen 7 5700X (8C/16T) + RTX 5080 16 GB (ReBAR ON, 1440p + DLSS Quality, warm cache, 3k–4k draws/frame):e1251c31)01..10+ flags)~13.1 FPS19.4 – 20.9 FPS(p7521.9, peaks22.5–26.0)+48% .. +59%FPS~76.3 ms47.8 – 51.5 ms-24.8 .. -28.5 ms (-32% .. -37%)refr)~33.2 ms13.7 – 15.6 ms-53% .. -59%ww_ask)~27.3 ms8.6 – 11.1 ms-59% .. -68%WW_hi > 5 ms)23 / 40ticks0 / 41ticks (ZERO)-100%VAD spikesmax frame_ms)156 – 358 ms62.7 – 73.1 ms(0 hitches >100 ms)-53% .. -79%stutter139/139unit tests PASS(Every individual patch and toggle below is also backed by its own isolated, same-binary paired A/B delta.)
Hardware & Measurement Methodology
1.614.1) + Windows 11.--releaseA/B (FLAG=0vsFLAG=1), strictly 3D-only frames (draws >= 1000), normalizedms / 1k draws, 1-second submitting-thread breakdown (med / mean / p90), plus visual verification and full unit-test passes (72/72 watch::,48/48 xmem::,18/18 send::,1/1 bury_tests).1. Zero-Rebuild & Runtime-Flag A/B Results (from previous discussion)
All numbers below are same-binary paired
--releaseA/B runs on the 8C/16T + RTX 5080 rig:VICTORY_COPY_BESIDE=1+VICTORY_STORE_BESIDE=1frame_med 65.40 → 51.50 ms (-13.90 ms / -21.3%),FPS 15.30 → 19.40 (+26.8%, p75 21.90),sub_total 61.60 → 44.60 ms (-17.0 ms),ww_ask 15.30 → 8.60 ms (-43.8%),WW_hi>5ms spikes 23/40 → 0/41 (ZERO),copies_mb -31.2%memcpyand single-word stores through the alias view besidePAGE_READONLYguards, eliminatingMmAddressCreationLockVAD-lock storms.VICTORY_D3D12_BACKGROUND=0ms/1k draws 23.56 → 18.54 (-21.3%),max frame_ms 163.3 → 83.5 ms (-48.9%),ww_ask 24.20 → 17.00 ms (-29.8%)VICTORY_PROCESS_MEMORY=0frame p75 -13.7 ms~100kVirtualQueryVAD-lock storms.VICTORY_WIDE_FILLS=0frame_med 63.55 → 56.70 ms (-6.85 ms, p75 -17.90 ms, max 358 → 67 ms),Commit -328 MBASK_FIRST=0,WIDE_FILLS=0,SWEEP_OFF_THREAD=0,UPLOAD_AHEAD=0,SNAP_BESIDE=0,SEND_BESIDE=0,SPLIT_PRELUDE=0,D3D12_BACKGROUND=0.VICTORY_WC_BAR=3(smart ReBAR)card 6.6 → 0.8 ms(91.1%of full WC speedup,0GpuWritereadback drops)!allow_uavwrite-combined buffers directly into ReBARD3D12_HEAP_TYPE_GPU_UPLOAD.2. Sequential Patch Series (
01→10, Isolated Secret Gists)Every patch carries a sanitized header (
Base commit: e1251c31,Mechanism,Env switch,A/B summary) and sits behind an explicitVICTORY_*toggle for risk-free A/B testing on any branch:01_sim008_guard_sharded_vp_stripe.patchVICTORY_GUARD_SHARDED=1(ON)VP_STRIPE(4 MiB) outside globalGUARDSlock →refreshes 33.2 → 19.4 ms (-41.6%),ww_ask 14.3 → 7.8 ms (-45.5%),frame_med 76.3 → 58.7 ms02_sim011_steps_fast_and_listed_twins.patchVICTORY_STEPS_FAST=1,VICTORY_LISTED_TWINS=0O(\log N)binary-searchtitle_written_ranges+8,788 → 0raw twins/f →frame_med 71.5 → 63.2 ms (-8.3 ms),prep 64.7 → 55.9 ms (-8.8 ms)03_sim010_m4_low_l0_dma.patchVICTORY_LOW_L0_DMA=1(ON)MEM_PRIVATE | MEM_WRITE_WATCH+OpenExistingHeapFromAddress1L0→L1 DMA (>=512 Bruns) →frame_med 67.60 → 58.45 ms (-13.5%),refr 23.10 → 15.75 ms,card 2.80 → 0.90 ms (3.1×)04_sim013_desc_mirror_cap_and_soft_batch.patchVICTORY_DESC_MIRROR_CAP=1,VICTORY_SOFT_BATCH=138 → 18.5 MiB) +4 MiBLAZY_ATbatched soft views →prep 61.30 → 44.85 ms (-26.8%),ww_ask 27.30 → 13.15 ms (-51.8%)(clean-applies with 0 conflicts ontoXSEmu/core)05_marsietiss_review_fixes.patchVP_STRIPEreopen guard, dropahead_intactheuristic, strict per-range landing-safeL0_DMAgate06_marsietiss_arming_and_strict_l0_gate.patchARMINGbitmap + real-pathprotect_here_stripedrace test (72/72 watch::), strictcard_l0_dma_allowsUAV gate (18/18 send::)07_prelude_shared_alloc_and_batch_cache.patchVICTORY_PRELUDE_SHARED_ALLOC=1(ON)ID3D12CommandAllocatorper submission (~136 → ~17–31resets/f) +Batch::addlast-key cache →prelude_rec max 8.18 → 4.87 ms (-40%)08_soft_fast_fills_and_stack_read.patchVICTORY_SOFT_FAST=1(ON)Step::Fill(1 QPC/flush vs~20k/f) + stackFastHit::Singleinsoft_read→run_deferred 4.73 → 3.17 ms (-33%),steps-refr 8.50 → 6.70 ms (-1.80 ms)(48/48 xmem::)09_lock_trim_watch_bury_desc.patchVICTORY_LOCK_TRIM=1(ON)PROTECTED || ARMINGbitmap fast-path intitle_memory_written+ 64 cacheline-alignedRETIREDshards with lock-freeAtomicU64oldest-fence skip inbury()+release_dynamic_batch→sub_lock 1.80 → 0.90 ms (-50%),sub_tot -1.90 ms,steps -2.00 ms,max_fms 155.9 → 73.1 ms (-53%)10_ask_flush_batch_write_watch.patchVICTORY_ASK_FLUSH=1(opt-in)watch::ask_more(&ranges)perBatch::flush/duepass whilewatch::is_kept()is active (0 extra threads, adapted fromXSEmuPR#162) →5s FPS +12.0%,ms/1k 24.20 → 20.18 (-16.6%),ww_ask 22.20 → 18.30 ms (-3.90 ms),max_fms 326.8 → 85.1 ms (-74%)3. Debugging Tools, Codebase Indexer & Launch/Build Guides (Secret Gists)
compare_ab_logs.py,parse_diag.py,run_paired_ab.ps1,run_hw_monitor_bench.ps1):build_code_index.py, ~1.5 s) & Local Official API Spec Search Stack (rg/fd/ast-grep/DirectX-Specs):.cargo/config.toml), Proven Silicon Laws & Closed Dead Ends:Credits & Reviewers from the Previous Thread
Huge thanks to @Marsietiss (deep code reviews that directly produced hardening patches
05and06plus zero-copy dead-end analysis), @tikD1337 (independent A/B validation on RTX 4070 Ti SUPER + Ryzen 5 7600 and cleanVICTORY_WC_BAR=3PR), and @zonehammer (RTX 4090 A/B data confirming thePAGE_READONLYread-explosion trade-off onGUARD_LEARN).Imported from readmet3xt-lab/foxhound. Originally posted by readmet3xt-lab on 2026-12-02T01:48:53Z.
Thank you for the detailed write-up and for offering it for reuse. The measurements are against another fork's base, whose watch and guard code differs from ours, so we can't carry the numbers over. Several of the switches in your first table already exist here and some are already on by default. We'll look at the striped guards and the lock trim first (patches 01 and 09) and port them behind switches if they fit, measured in our own A/B runs, with credit. If you can make the patches public gists, or a branch, that would make them easier to review.
Imported from readmet3xt-lab/foxhound. Originally posted by Marsietiss on 2026-12-02T02:19:25Z.
@procotos-art — we ported the write-watch private substrate + L0 DMA + WC_BAR from your stack (behind switches, re-derived for our tree, with credit). The substrate runs, but L0 opens 0 heaps and we'd like your read on the scope.
What we measure (RTX 5080, Ryzen 9 9950X3D, 32 GB, our own A/B):
write watch over the 32-bit private runs: ~147 askings run-by-run, ~4.5 ms in them, ~3.9 GB walked/frame; 4KiB pages named split landed-by-us vs the title's.L0_DMA: 0.0 MB in 0 runs; a heap opened on 0 card copies — title memory under write guards is not private memory committed whole and is not opened. AndWC_BAR: 0 of them placed 0 MB.Our read of the cause (code): we make the 32-bit graphics reservation (~185 MiB) private + write-watched (your patch's target). But our L0 is tried on the big copy-back card copies, whose title memory is a ~1.3 GB private heap plus section pages the title maps at 3–60+ addresses — not the graphics reservation. Our
private_wholegate (VirtualQuery:MEM_COMMIT,MEM_PRIVATE,PAGE_READWRITE, one region covering the whole range) refuses those, so no heap opens. We pay the asking cost for zero DMA gain.Questions:
Happy to share counts/logs. What would you try?
Imported from readmet3xt-lab/foxhound. Originally posted by Marsietiss on 2026-12-02T02:42:47Z.
@procotos-art that matches our read exactly. Our eligibility seam (a gate requiring one MEM_PRIVATE committed-whole region) is pointed at the wrong allocation class: the card copies map section pages shown at 3-60+ addresses, not the private graphics reservation.
We already have a design for the one-home-per-physical-page model: one holder record per (section, offset), one owner copy whose card buffer holds the truth, every other copy over the page brought current from the owner before a submission uses it. An independent refute left 6 open P0s before anything may be held, mostly around a DirectStorage write to physical pages under a held page, the landing fence ordering, partly-changed dwords, and alias invalidation.
Your native Prologue evidence is the missing piece. To answer those P0s against what actually worked, could you share the run-based patch details:
We will fold this into the design and re-refute before building anything that holds memory. Happy to share our design text and the P0 list.
Imported from readmet3xt-lab/foxhound. Originally posted by procotos-art on 2026-12-02T02:45:34Z.
Thanks for testing and sharing the exact breakdown, @Marsietiss — your log lines pinpoint the causes pretty cleanly. Here is what our logs show for each of the four points (measured on Ryzen 7 5700X 8C/16T + RTX 5080 16 GB ReBAR ON, Agility SDK
1.614.1):1. What memory L0 DMA actually opens on (and why yours opened
0)We do not open L0 DMA on the ~1.3 GB 64-bit copy-back heaps (
try_open_low_l0_dmaexplicitly skipsstart >= (1u64 << 32) || len < (16 << 20)). It opens one heap, specifically on the 32-bit graphics reservation:0x10000(185 MiB,MEM_PRIVATE | MEM_WRITE_WATCH).XMemMapPhysicalPagescommits land:0x10000(10 MiB, GPU-RO),0xa10000(1 MiB, GPU-RO),0xb10000(27 MiB, GPU-RO),0x2610000(47 MiB),0x5510000(100 MiB).174 MiBCardbuffer (start=0xb10000, len=182,452,224, allow_uav=true), whose first27 MiB(0xb10000..0x2610000) is marked GPU-read-only.OpenExistingHeapFromAddress1opens on0xb10000+0xae00000(bias=0), and our hardened per-range gate (!send_changed && !changes_only && (!allow_uav || range_is_gpu_readonly)) routes only the GPU-RO subrange to directCopyBufferRegion(L0 -> L1). In our latest paired A/B on the rebased37ff585tree that moves3.2 MB / 130 runs/framevia L0 DMA, cuttingSEND_OWNCPU copy2.37 -> 0.93 ms,card_mem 2.60 -> 1.15 ms, and1s refr15.4 -> 11.25 ms(p90 23.1 -> 15.4 ms),5s FPS 16.50 -> 19.55(0 errors).Why
private_wholerefused yours ("title memory under write guards is not private memory committed whole"):PAGE_READONLYsplittingVirtualQuery: If any write-guard / cold-WW-RO pass marks pages inside0xb10000..0xb910000PAGE_READONLYbeforeplace_part,VirtualQuerysplits the region andprivate_wholerejects it. In our tree with cold-WW-RO, we had to runwatch::prepare_for_l0_dma(start, len)(restoringPAGE_READWRITEand blocking future RO promotion) right beforeplace_part.title_virtual_freetreatsMEM_PRESERVE_PLACEHOLDER | MEM_COALESCE_PLACEHOLDERSinsidePRIVATE_LOW_RESas a no-op (returning1, while still clearing GPU-RO on coalesce), and verify that0xb10000+0xae00000actually enters theCardcreation path (not split into<16 MiBpieces or intercepted earlier).2. Avoiding the alias-fallback storm and the
~147 askings / ~3.9 GB walked / ~4.5 mscostMEM_PRIVATE— they stay on section views with shardedVP_STRIPE+ARMING+COPY_BESIDE=1+STORE_BESIDE=1. The185 MiB32-bit reservation has 0 aliases in this workload (we keep anerror!alias detector inmap_pagesand it stays at 0).~147 askings / ~3.9 GB walked/frameon 185 MiB:3.9 GB / 185 MiB ≈ 21×full walks per frame (~147 per-runGetWriteWatchcalls). In our stack,ask_oncecoalesces write-watch queries per reservation (ask_once_by_res) and caches dirty results in the per-submissionJournal(ASK_FLUSH=1batchesask_moreonce per flush instead of per copy). Without reservation-level coalescing + journal caching,GetWriteWatchre-walks the same185 MiBdozens of times per frame and eats the DMA win.3. GPU DMA writebacks vs
GetWriteWatch& single private poolAgreed 100% on the hardware behavior: GPU DMA writes bypass the CPU MMU PTE dirty bit, so
GetWriteWatchreports 0 pages and any GPU→CPU landing must explicitly notify tracking (Journal::note/ write epoch). That is why ourl0_dma_range_safegate forbids L0 DMA on any UAV-writable (non-GPU-RO) subrange rather than trying to mix zero-copy GPU landings with write-watch. A single committed-whole private pool is great for un-aliased regions (like the 32-bit reservation), while aliased 64-bit pages still needMEM_MAPPEDviews so CPU writes through one alias remain immediately coherent at the other 3–60+ VAs without copying.4. Why
WC_BARplaced0 MBfor youIn our runs on the same scene with
WC_BAR=3(smart), it places 3,005 buffers totaling 683.9 MB (92buffers>= 1 MiB,2,913buffers< 1 MiB, e.g.0xe770f0000+24 MiB,0xda5c3df00+24 MiB,0xda51c0000+10.5 MiB,0xd5e566000+2 MiB). Three things to check on your tree:XMemVirtualAlloc: The title requests ~4.6 GB with the console WC bit0x400set (protect = 0x2404for2199 MBat0xd49400000and2413 MBat0xe2c000000, plus0x42404).title_memory_write_combined(at, size)must check the rawasked & 0x400 != 0before masking off console protection bits for Win32; otherwiseis_write_combined()always returnsfalse.D3D12_HEAP_TYPE_GPU_UPLOAD: ConfirmGPUUploadHeapSupported == trueat startup (card memory the CPU maps supported=true). Without ReBAR + Agility SDKD3D12\D3D12Core.dll(>= 1.610) beside the binary,mapped_card_buffer()quietly returnsNone->0 placed.1requires aWC_NO_BACKcutoff to be set; mode3/smart(!allow_uav || cutoff.is_some_and(|min| len >= min)) is what admits allno-UAVWC buffers of any size directly into CPU-mapped VRAM.For reference, we just rebased the clean-room
GUARD_SHARDED+LOW_L0_DMA+LOCK_TRIM/ASK_FLUSHpatches (MIT-0) onto37ff585here: https://gist.github.com/procotos-art/6e1d42c88281148cb0f75a2be716fb82Imported from readmet3xt-lab/foxhound. Originally posted by Marsietiss on 2026-12-02T05:53:44Z.
Findings from implementing and canary-testing the per-run L0 path on an RTX 5080, and the flight-snapshot gap it exposed. Credit to @procotos-art for the eligibility seam, the ask-once-per-reservation idea, and the recovered first-draw snapshot discipline.
The multi-allocation wall is real and the per-run open works. A heap span crossing two private allocations is refused by the host (parameter error), and a whole-region query sees two regions. Our substrate makes one allocation per mapping call, so a large multi-commit buffer cannot open whole. Opening on the largest GPU-read-only run (one allocation, >=16 MiB) succeeds on the 5080: whole-buffer refused, per-run fallback opened one heap, ~3.5-3.9 MiB / ~127 runs per frame sent direct (your paired figure was ~3.2 MiB / 130). Source offset bias + a - off with span containment; a byte-exact card canary (off != 0 and off = 0, every byte of five runs) passes, and the old wrong formula reads out of the placed span.
But L0 direct is NOT a flight snapshot, and that is the wrong-texture corrupter. A card canary records an L0 CopyBufferRegion, rewrites the source ring before execution, then submits: the destination holds the rewrite's bytes (all differ), and two flights recorded on one ring slot cross-contaminate (flight N reads N+1). The prepare-time upload-snapshot control holds its own epoch in both cases. So the patchy/wrong-material world tiles are a source-epoch violation, not an offset bug: the title runs ahead of deferred flights and reuses ring slots between record and GPU execution, and a live-memory read delivers the newer epoch.
Impossibility, confirmed from both sides. There is no mechanism that lets the title overwrite a live ring slot while guaranteeing a delayed GPU copy still reads its previous contents. Generic native direct imports assumed a serialized flight. Your recovered first-draw hybrid is the solution: capture exact descriptor/CBV/VB bytes into flight-private storage at exact offsets (never round the guest address down into neighbors), retain until the consuming fence retires, recheck the source immediately before submission and refuse + rebuild if it changed, never refresh a snapshot while its flight is active. The stricter L0 form (block guest writes while the GPU consumes, release after fence + visibility) only works with that serialization or blocking.
Adopted direction. Mutable / reused-ring sources and descriptor/CBV/VB use the flight-private snapshot; true zero-copy L0 only where the source is provably held stable or flights serialized (fail closed to snapshot otherwise); write-combined buffers get a per-flight card-memory ring (freeze epoch N in buffer N). The frame win is then from DELETING GPU-write machinery (copy-back, landing, card compare, dword merge, descriptor dirty-sync, flight wait for returning bytes) for the proven CPU-owned epoch-frozen set, not from DMA volume. Asking is one walk per noted reservation per flush with every asking in that flush answering from the journal.
Open. A reuse/stability classification is a property of the past, not the future bytes at record, and we have no ring/shader-binding metadata, so fail-closed makes snapshot the default for mutable memory; the ownership trim (delete-work) is gated behind the epoch proof. Runnable canaries now cover byte-exactness, flight-snapshot (destination vs snapshot at the submission's own fence), watch-after-open, GPU-DMA blindness, overlap identity, guard pages outside the range, and ordered CPU/GPU collision.
Imported from readmet3xt-lab/foxhound. Originally posted by Marsietiss on 2026-12-02T08:14:14Z.
Update after canaries, refutes and a contract pass. Credit @procotos-art for the eligibility seam, ask-once-per-reservation, and the recovered first-draw snapshot discipline.
Per-run L0 works mechanically on the 5080: whole-buffer open refused (host refuses a span over two allocations), per-run heap on the 27 MiB GPU-RO run opens, byte-exact (offset bias+a-off verified every byte), ~2.4-3.9 MB / 112-128 runs direct per frame.
But deferred live-read breaks source-epoch (our PB-23), and that is the wrong-texture / patchy-road class. Card canary: record an L0 copy, rewrite the source ring before execution, submit -> destination holds the rewrite's bytes; two flights on one slot cross-contaminate; the prepare-time upload-snapshot control holds its own epoch. Impossibility confirmed from both sides: nothing lets the title overwrite a live ring while a DELAYED GPU copy reads the previous contents; generic native direct imports assumed a serialized flight. Your recovered first-draw hybrid (exact flight-private snapshot, retain to consuming fence, recheck before submit / refuse+rebuild, never refresh while active) is the correct fallback for mutable memory.
The "delete GPU-write machinery" trim is subsumed by the shipped unified_back default: leaves(ReadOnly, GPU_RO)=true keeps GPU-RO pieces on the card (no fetch/land/put-back). The ~2 ms we measured came from running UNIFIED_BACK=0, a non-default that re-declares them. Trim parked.
Route now being built to make LIVE zero-copy epoch-correct without a CPU snapshot: prompt-L0, executing the direct copies same-frame (own list + immediate submit + fence on the copy queue) so the live source read lands before the title's next ring write. Verifying road-clean + fps with L0 live. Fallbacks if the latency bound is unreliable: copy-on-write ring rename (fault-intercepted, guarantees the old epoch) or the flight-private snapshot.
Synthesis: an adaptive per-region/per-flight policy choosing the cheapest correctness-preserving strategy (leave-on-card / live-L0 for provably-immutable / prompt-L0 / COW ring rename / epoch-frozen snapshot / full copy-back), promoting on positive evidence and demoting on any epoch mismatch. Zero-copy becomes one option the layer picks, not a global mode.
Ready safe config measured at the road spot: unified_back=1 + epoch class + asking loop = 22.5 fps / 44.5 ms at 10518 draws (4.23 us/draw) vs unified_back=0 baseline 20.3 fps / 49 ms at 9150 draws (5.36 us/draw); copy-back 7.7 -> 3.0 ms.
Imported from readmet3xt-lab/foxhound. Originally posted by Marsietiss on 2026-12-02T16:32:24Z.
Zero-copy placement findings (measured, continuing this thread):
A pool the translation reads on the CPU must live in PC memory the card reads over the bus, not in CPU-mapped card memory. CPU reads of CPU-mapped VRAM crawl (~40 MB/s effective); one upload ring measured ~814 ms/frame in CPU-mapped card memory vs ~25 ms in PC memory. The card reads such a pool about once a frame, so the bus cost is small; the CPU read speed is what matters. (PCIe read bandwidth is a hardware limit.)
A host-opened pool has no write watch. A CPU-side refresh then copies everything it is asked for at each submission (~164 MB/frame of redundant copies measured) unless the card copies from the pool buffer instead. Removing the write watch needs a refresh-source plan.
The upload pool is a placeholder split into several pieces (the write-combined ring is one piece, already DMA-able as a GPU-read-only run). Host-opening the whole pool as one committed region is a substrate change, and the physical pages are shared/aliased across addresses, so sharing must be preserved.
The submitting thread's remaining cost is asking, not moving bytes: a large texture block spends ~10 ms/frame refreshing ~2 MB, and the title's own small copies ~8 ms for under 0.5 MB. Compare-first stores (skip a store that writes what is already there) measured ~34.6 vs 36.2 ms in 12 of 14 pairs.
All switch-gated and fail-closed. Matched-draws A/B at a fixed spot is the bar; us/draw alone drifts.
Imported from readmet3xt-lab/foxhound. Originally posted by Marsietiss on 2026-12-02T17:05:06Z.
@readmet3xt-lab see https://github.com/Marsietiss/Mangrove/tree/zero-copy
Status: implemented behind switches (default off = byte-identical old path). The card can DMA directly from the title's own memory for proven CPU-owned / GPU-read-only intervals; the CPU shuttle is removed for those runs. The frame win is expected to come from DELETING GPU-write machinery once ownership is proven, not from DMA volume (see Roadmap).
Imported from readmet3xt-lab/foxhound. Originally posted by procotos-art on 2026-12-02T21:03:56Z.
Update: 23.95 med / 31.8 Peak Native FPS in Indoor Scenes (0 FrameGen) + Full Toolkit/Skills + Help Wanted on Flicker & Stutters
Sharing our latest clean-room patch series (
01..12), full debugging toolkit/skills/scientific protocol, and a concrete RFC / help request on the remaining flicker and periodic frame stutters.01..12.patch, base37ff585->2a8dd99, MIT-0): https://gist.github.com/procotos-art/6e1d42c88281148cb0f75a2be716fb82Measured Progression (8C/16T Zen 3, 32 GB DDR4, 16 GB ReBAR GPU, Native 1440p + DLSS Quality, 0 FrameGen)
frame_ms(med)prep(med)ms/1k draws37ff585, defaults)13.15/ —76.0501..09(GUARD_SHARDED,LOW_L0_DMA,STEPS_FAST,WC_BAR_NO_CPU_READ,READABLE_FAST,UPLOAD_AHEAD=1,INDIRECT_BATCH=3)20.90/26.847.835.119.2PASS_4MS_H0+ Visual Pack11(RAYMISS_ZERO,EMISSIVE_FALLBACK,FRESH_FIRST,KEEP_SHOWN=2)23.95/31.8(indoor 1.1k–2.0k draws;18.4–20.0at 3.8k–4.0k draws)41.928.617.89(To be completely transparent: 30+ FPS peak is in indoor scenes, and periodic stutters/freezes
>100 msplus intermittent flicker still occur during camera cuts and panning.)Help Wanted: Flicker, Post-Cut Underload & Periodic Stutters (
H1 / H2 / H3)We added
DARNER_ARTIFACT_DETECT=1v2 (12_darner_artifact_detect_v2.patch— pure-GPU 96x54 compute shader, ~30 us/frame, 0 CPU threads) to separate and measure the remaining visual defects deterministically:SCENE_FLIP: >=10% of screen strong 1-frame A-B-A flip (dRGB >= 45).OBJ_FLICKER: localized sharp A-B-A (dRGB >= 65ordSpr >= 80, >=6 tiles, logs(pct_x, pct_y)).CUT_UNDERLOAD/UNDERLOAD_LAG: post-cut pop-in (cut+2..cut+60) + directHEAP_TEXTURES_QUEUElag (due_slots,oldest_due_frames > 15).Three competing hypotheses we would love community feedback / PR ideas on:
H1(TextureQueuelock contention & starvation underPASS_4MS_H0): WithTEXSPK_PASS_MS=4, HURRY_PASSES=0, FRESH_FIRST=1,due_slotsclimbs to21,333,oldest_due_framesreaches183 frames(~9 s!), andqlock(waited for locks: the queue's ... by other threads) explodes 7.4x (587 ms -> 4,365 ms / 5sacross 8 worker threads!). Any ideas for a lock-free / O(1)std::mem::takedrain + out-of-lock prioritization inTextureQueue::ordered_withso 8 recording workers stop stalling onqlockwhile keepingduedrained?H2(Replaced texture copy lifetime): Upstream3b2560f4waits forreferences(&host.texture) == 1before dropping replaced texture copies — testing whether that eliminates localized 1-frame missing-texture flips.H3(Async submit/present race underSUBMIT_SPLIT=2): Testing upstream5b273e10(DARNER_PRESENT_SENT=1) and camera-panning stability on the latest upstream (8050243).Full Dead-End Ledger (including why
MAKE_TWINNED_FAST,TEXTURE_TRUST_GUARD,BUF_COPY_DEDUP,TEXTURE_SOFT_MB=8192,PRELUDE_UPLOADS=0, etc. were dropped) and our automated log/video-audit tools are in the Toolkit Gist above.Imported from readmet3xt-lab/foxhound. Originally posted by procotos-art on 2026-12-02T22:31:12Z.
Important Correction: Earlier
01..12Patch Stack Is Deprecated (Analysis Only — Do NOT Apply In-Game) + High-Performance Sibling D3D12 Architecture FindingsFollowing strict controlled 3-minute fast-camera-spin A/B benchmarks (8-core / 16-thread x86-64 + 16 GB ReBAR-ON RTX GPU, Agility SDK
D3D12Core.dllverified), I want to be completely transparent and save everyone time:1. Do NOT apply our earlier
01..12patch stack in-game — keep strictly for post-mortem analysisOur earlier
01..12patch series (rebased on legacy37ff585/2a8dd99) looked good in short 50s static indoor captures, but regresses badly under real sustained camera motion compared to clean upstream8050243(v2026.12.02.01):frame_ms(med / max)>100 msfreezesTextureQueue(due/oldest)01..12stack (2a8dd99+PASS_4MS_H0)20.30 / 18.99 / 26.3049.3 / 1031.1 ms2due=3,955 / oldest=62f406)8050243(defaults + Agility SDK)22.30 / 22.53 / 32.4044.9 / 68.3 ms0due=0 / oldest=0f8050243+WC_BAR_NO_CPU_READ=1(reverted)21.80 / 21.65 / 27.6045.9 / 282.2 ms1due=0copyback 19.0 -> 9.3 ms)8050243+DARNER_HEAP_HOOKS=1(vs20.30spin base)18.20 / 17.85 / 23.9055.1 / 310.9 ms2due=0-2.10 FPSregression8050243+HEAP_HOOKS=1 + SUBMIT_SPLIT=0 + PRESENT_SENT=118.85 / 18.47 / 24.5053.0 / 148.1 ms1due=0-1.45 FPSregression, residual flips unchangedKey post-mortem takeaways (all logged in our Dead-End Ledger Gist):
PASS_4MS_H0(TEXSPK_PASS_MS=4 + HURRY_PASSES=0) starves the texture upload queue under camera movement (duegrows to thousands, causing late pop-in).WC_BAR_NO_CPU_READ=1halves asynccopyback(19.0 -> 9.3 ms), butrelayruns off the critical path (zero FPS gain) while skipping< 1 MiBwrite-backs corrupts aliased/placed surface data (visible blotches).D3D12\D3D12Core.dllbeside any rebuilt runtime binary; falling back toSYSTEM32\D3D12Core.dllsilently disablesGPU_UPLOAD/ ReBAR /HEAP_TWINand causes GPU hangs.01..12) has been clearly markedDEPRECATED — ANALYSIS ONLY / DO NOT APPLY IN-GAME.2. High performance, timely asset streaming, and zero frame-flipping in the sibling D3D12 translation tree (
b417632)In parallel, we built and tested the active sibling D3D12 translation tree (commit
b417632, clean default configuration + warmed shader/pipeline cache) on the exact same 8-core + RTX 5080 host, and the difference in real-world playability, visual stability, and throughput is dramatic:SUBMIT_SENDER=1+SHOW_AFTER=1+UPLOAD_AHEAD=1, avoidingSUBMIT_SPLIT=2submission races and upload queue caps).PORT_DESCRIPTORS=1,INDEX_HEAP_SPANS=1,PORT_JOURNAL=1) paired withALIAS_DIRECT=1texture mapping.PAIRED_FORacross 45 key lighting/temporal/shadow/defrag compute shaders +NAN_SCRUB=1).PIPELINE_WAIT_MS=10000instead of silently dropping model draws when a PSO is not yet cached).We are updating our benchmark & analysis priority to focus on that higher-performing D3D12 architecture going forward, and keeping the older
01..12patch Gist strictly as a cautionary negative-result archive alongside the updated Dead-End Ledger:01..12Patch Pack (Analysis Only — Do NOT Apply): https://gist.github.com/procotos-art/6e1d42c88281148cb0f75a2be716fb82Imported from readmet3xt-lab/foxhound. Originally posted by procotos-art on 2026-12-03T12:19:26Z.
Offline Pipeline Precompiler Optimization (
warm.rs+pipeline/known.rs) —3.88xFaster,-50%RAM (Opt-In Patch)Following up with a verified, opt-in optimization for offline full-cache pipeline precompilation (
warm/preload --all), which previously crawled at~18–29 pipelines/s(~55–60 min for ~88.6k PSOs) on 8C/16T x86-64 + 16 GB ReBAR GPU.Root Cause (Measured on
known-pipelines.bin)88,677pipelines, there are only15,067unique shader combinations (5.89xduplication) and19,108unique individual shaders.warmspawns 10–14 single-threaded child processes withAT_ONCE = 40,IDLE_PRIORITY_CLASS, and random pipeline-key sorting (~2,200 cold process spawns per full run). Every 40 pipelines destroys the in-process translated shader cache (static SHADERS) and driver in-process compiled-stage cache, while scattering graphics-state variants of the same heavy pixel/compute shader across separate processes.Mechanism (Default OFF = 100% Byte-Identical Upstream Behavior)
All new behavior is opt-in via environment variables (
DARNER_WARM_JOBS,DARNER_WARM_THREADS,DARNER_WARM_BATCH,DARNER_WARM_PRIORITY,DARNER_WARM_SORT,DARNER_WARM_ADAPTIVE,DARNER_WARM_MIN_FREE_MB):known::make_parallel(1child process xNworker threads): Shares oneID3D12Device, shader index,static SHADERScache, and driver cache handle — halving peak RAM and removing cross-process DXCache contention.<= 16) combo group-stealing (DARNER_WARM_SORT=shader): Leads each sort key with the last shader's 32-byte BLAKE3 hash (pixel shader for graphics, compute shader for compute) + combo bytes — keeping stage distribution uniform across slices while executing state variants of the same shader back-to-back on the same thread (variant #1 compiles, variants #2..N hit in ~0.1 ms).DARNER_WARM_ADAPTIVE=1): Every 2 s reads Win32GetSystemTimes - GetProcessTimesandGlobalMemoryStatusExto yield worker slots automatically when external apps use CPU, and cleanly recycles batches early if free RAM drops belowDARNER_WARM_MIN_FREE_MB(default3584 MB).fill_library: ReplacesNseparateknown::makecalls (up to12.96 GBRAM + static.step_bystragglers) with one sharedknown::make_parallelpass +shader_sort.@filehandoff: If a multi-threaded child crashes or hangs, only uncompleted items in that chunk are retried single-threaded (threads = 1). Lists> 400indices pass via a temporary@file.Bracketed Paired A-B-C-A Silicon Results (Ryzen 7 5700X + RTX 5080, 2,000 uncached PSOs/case,
0refused,0crashed)A1_BASE(14x1, b=40, idle, key)73.95 s27.04/s1.00x23.3 ms1194.7 ms782 s6,615 MB15A2_BASE(14x1, b=40, idle, key)62.94 s31.78/s1.00x6.0 ms1197.8 ms750 s6,914 MB15A1, A2)68.45 s29.22/s1.00x14.7 ms1196.3 ms766 s6,765 MB15F1(1x16, b=2000, norm, key)36.92 s54.17/s1.85x1.3 ms738.7 ms506 s(-34%)3,368 MB(-50%)2G1/G2(1x16, b=2000, norm, ps-hash)17.66 smean113.25/s3.88x(+288%)0.1 ms62.3 ms236 s(-69%)3,392 MB(-50%)2Thread-Scaling Follow-Up (
1x8Physical Cores vs1x12vs1x16SMT,sort=shader, 2,000 PSOs/case)T16_A/T16_B(1x16SMT):28.99 s / 21.74 s(mean25.37 s=78.8/s),p90 42.3 ms,sum 327 s,RAM 3,916 MBT08(1x8physical cores only):23.38 s(85.53/s),p90 16.7 ms,sum 166 s,RAM 3,426 MB, leaving 50% CPU headroom!T12(1x12):29.94 s(66.81/s),p90 206.8 ms,sum 314 s,RAM 3,847 MBSumdoubled166 s -> 327 s=1.97xat 16 threads for zero wall-clock gain). Defaulting to1xPhysCores+DARNER_WARM_ADAPTIVE=1+ adaptiveWARM_BATCH=10000is both faster and keeps the desktop responsive.Dead ends also logged (so others skip them):
Multi-process batch bump alone (
14x1, b=80, normal, key):DROP(27.89/svs28.45/sbaseline, same6.06 GBRAM — tail imbalance + 14-way DXCache contention).Stage-prefix sort (
(stage_0, hash_0)):DROP(front-loads VS-only pipelines and piles heavy compute shaders at the tail; leading with last-shader BLAKE3 hash fixes this cleanly).GraphicsState"don't care" field canonicalization (known-pipelines.binbinary audit):DROP(0.00%— across all88,569real PSOs and all 6 D3D12 don't-care rules, only4PSOs deduplicated:88,569 -> 88,565; the title engine already canonicalizes unused fields).Clean-Room Patch Gist (
e6245bf,17/17tests pass, 0 warnings, MIT-0): https://gist.github.com/procotos-art/84611bdb2fc6dada51a6b34932f61202One-Click Smart Cache Warmer (
12_tool_smart_cache_warmer.ps1with SHA-256 skip-stamp + live cache size +13_Warm_Cache_Fast_Used.bat+14_Warm_Cache_Full_ALL.bat) & Dead-End Ledger Gist: https://gist.github.com/procotos-art/e0e1b3a1be41d3648045189cf5c08a6c(Drop the
.ps1and.batfiles into any folder and double-click — auto-discovers runtime binary, existing cache folder with zero duplication, title folder, and live CPU/RAM/VRAM limits, and automatically activates the3.88xflags on patched builds while remaining 100% compatible with stock builds.)