Commit Graph

406 Commits

Author SHA1 Message Date
daf7242f2e Merge remote-tracking branch 'origin/main' into carry/hwrt-2972
# Conflicts:
#	d3d12/scripts/play-nvidia.ps1
#	scripts/play-d3d12.ps1
2026-12-02 06:57:33 +01:00
8422def759 Merge pull request #3032 from enlight3d/cold-start-wait-clock
d3d12: time each begin and end of a pipeline wait under its count's lock (D3D12-COLD-START-SKIPS follow-up)
2026-12-02 03:16:02 +00:00
4b735e5556 d3d12: time each begin and end of a pipeline wait under its count's lock (D3D12-COLD-START-SKIPS follow-up)
After a wait, wait_in read the clock once, before taking the lock of the
frame's count and that of the pipeline's own count, and told both ends
that time. A thread stopped between the read and the lock had its end
told after events with later times, and Waited took the order it was
told as the order of the times (review of pull request 3000):

- andrew-ai: A waits 0-20 ms, B 10-85 ms; with A's end told after B's,
  a wait at 86 ms was left 80 ms of 100 instead of 15, and a pipeline
  both waited for was charged 20 ms instead of 85;
- merzleckeier: A waits 0-10 ms, B 40-50; with A's end, read at 10,
  told after B began, B was left 60 ms instead of 90, the frame had 50
  left instead of 80, and the pipeline was charged 50 instead of 20.

Each begin and end is now timed under the lock of the count it goes
into, through a seam (trait Waiting: the clock and the wait; Real in
the title), so a count is told them in the order of their times. Waited
keeps the latest time it has seen and takes an older one as that: an end
gives back nothing, a begin counts nothing twice. The frame's end is
timed right after the pipeline's, before the log lines.

A wait still counts until its end is timed: a thread stopped after its
wait and before it reads the time counts as waiting meanwhile (test
a_wait_counts_until_its_end_is_timed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 03:31:18 +01:00
5922f9fc5b Merge pull request #2663 from zmasi/fix/d3d12-depth-bounds-test-flake
d3d12-gpu: keep depth stage active on WARP for bounds-only pipelines (D3D12-DEPTH-BOUNDS-TEST-FLAKE)
2026-12-02 00:48:56 +00:00
923a4e98f2 d3d12 hwrt: an AABB geometry's range ends with its last box
The shadow lookup and refresh asked for count * max(stride, 24) bytes, past the last box
(two boxes at 0 and 64: 128 bytes where 88 are used). aabb_span takes (count - 1) * stride + 24
with checked arithmetic; a test covers the last box ending at a buffer's end and overflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 01:32:06 +01:00
5a8e1db178 Merge remote-tracking branch 'origin/main' into d3d12-hardware-ray-tracing
# Conflicts:
#	d3d12/crates/leonida-gpu/src/descriptor/host.rs
#	d3d12/docs/switches.md
2026-12-02 01:20:51 +01:00
ce08fea0af Merge pull request #3000 from enlight3d/cold-start-skips
d3d12: the threads of a frame share its pipeline wait budget and none is left with nothing (D3D12-COLD-START-SKIPS)
2026-12-02 00:03:59 +00:00
3a38a050d8 d3d12 hwrt: review addendum (one capability gate, AABB strides, TLAS layout, copy modes)
- One gate for both halves: supported() also asks for shader model 6.6, and the translator is
  told inline ray tracing runs (set_host_inline_rt) only once the DXR manager is made.
- AABB geometries take stride 0 (packed 24-byte boxes) and multiples of 8 of 24 or more, as
  DXR does; others are refused.
- A TLAS of instances by pointer (ARRAY_OF_POINTERS) is not built: the remap reads 64-byte
  instances in a row.
- Structure copies other than clone and compact are not done (said once).
- A TLAS clone points the heap slots that view the destination at the shared structure.
- The points not fixed here are listed in fork-ray-tracing.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 00:40:30 +01:00
2705632c56 Merge pull request #2852 from Kal0s-design/fix/page-writes-per-heap
d3d12-gpu: physical-page writes reach every view heap's texture pass (D3D12-GPU-PAGE-WRITES-PER-HEAP)
2026-12-01 23:12:32 +00:00
d6baf3528d Merge pull request #2857 from djrolfes/djrolfes/gpu-pool-small-unlock-grow
gpu/pool/small: release pool mutex during CreateHeap block growth (D3D12-POOL-SMALL-GROW-UNLOCKED)
2026-12-01 23:12:28 +00:00
9cedb84c93 d3d12 hwrt: review fixes (transform opcodes, no hardware path without DXR 1.1, cleanup)
- rq_op: 187 is CandidateWorldToObject3x4 and 188 CommittedObjectToWorld3x4 (they were
  swapped; checked against dxc 10.0.26100). the_ray_query_opcodes_are_dxils pins all 35.
- Hardware ray tracing runs only where it can: hwrt::active() (asked for, and a DXR 1.1
  manager made) gates the HLE module, the left-out passes, the copy-back rule and the counters;
  the translator lifts loops only when the host says it runs inline ray tracing
  (set_host_inline_rt, in host_settings and so in the shader cache's key). Elsewhere the title
  keeps its own XboxBvhBuilder.dll and the software walk.
- No env write: builder_allowed() is LEONIDA_BVH_BUILDER=1 and not hwrt::active().
- dxr.rs removed (nothing bound its wrappers); TLAS views are kept out of the list views only
  with the path on; the off16 diagnostics and the xmem log lines are gone.
- as_sizes split out of alloc_or_reuse_as, with a test; the known gaps are in
  fork-ray-tracing.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 00:01:01 +01:00
913b88b905 Merge pull request #2884 from lixonik/fix/timeline-stall-test-parallel-flake
d3d12-gpu: stabilize global stall routing test under parallel diagnostics runs
2026-12-01 22:35:46 +00:00
7c69bc8b19 d3d12: the threads of a frame share its pipeline wait budget and none is left with nothing (D3D12-COLD-START-SKIPS)
The shared frame budget was a reservation: the first recording thread to
wait in a frame took all that was left of it, and every other thread of
that frame (and any thread still on an older frame) got nothing, so its
draw went out without a wait and was dropped as not made. On first starts
(no pipeline book) 400 to 3,600 draws, dispatches and indirect executions
a frame were dropped at the arrival in the world, and the character's
head, drawn by a pass the title runs once, stayed missing for the run.

- The frame's waits are counted once over the threads that wait at the
  same time: what passed while at least one thread waited. A thread that
  begins to wait while others do is left what is left at that count, so
  waits that overlap still cost the frame its budget once; the time a
  thread records between two waits is not counted; a thread on an older
  frame joins the current frame's waits and opens no budget of its own
  (#2601). On by default; LEONIDA_PIPELINE_WAIT_DEADLINE=0 reserves the
  frame's budget as before (no effect with LEONIDA_PIPELINE_WAIT_SHARED=0);
  LEONIDA_AB can turn it while the title runs.
- A pipeline's own budget (LEONIDA_PIPELINE_WAIT_ONCE) is charged the same
  way, the real time once, not the threads' times added up, whatever the
  sharing of the frame's budget (LEONIDA_PIPELINE_WAIT_ONCE=0 turns that
  budget off).
- The queue a wait moves its pipeline forward in and the budget a
  pipeline's waits count against are passed in, so that tests cover them;
  one line tells the rules in use at the first wait.

AI-assisted: Claude Code (Claude Opus 5.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 23:10:50 +01:00
3fdfbaa46f d3d12: hardware ray tracing on DXR 1.1 (LEONIDA_HW_RT, off: a trial)
In place of -RayTracing (the title's structure builder and software traversal as translated
shaders): the title's XboxBvhBuilder calls become host DXR 1.1 bottom and top levels, and the
traversal loops of its trace programs become inline ray queries.

Ported from trustno1-coder/VIctory-NVIDIA (its #3706; from Leslie-d-a/VIctory-NVIDIA-HWRT 61e389e0
and 5f55bca8, original by dakisback2 ecc49d5b and 72f8316a), GPL-3.0, and fitted to this tree:

- leonida-shader: emit/rayquery.rs wired into lower.rs (the plan, the handles, TLAS root SRVs
  t230..t241, the analyses that leave the lifted loops out). A program in the paired form is not
  lifted. With LEONIDA_HW_RT=1 the node test of a loop left unlifted misses every node
  (emit/intersect.rs bvh_miss): the console structures are never written then.
- leonida-gpu: hwrt.rs (and dxr.rs for its records); list::external with a LEONIDA_THIN op for the
  structure work at its place in a title list; the TLAS views in the descriptor heaps;
  Deferred::held; the ray queries in the shader cache's entries; counters in the frame log.
- leonida-hle: modules/xboxbvh.rs replaces the exports of the title's XboxBvhBuilder.dll when on.
- With it on the light stand-in stands aside and the passes left out without structures run.
  Shader writes are not all copied back as VIctory-NVIDIA does (LEONIDA_HW_RT_COPY_BACK=1 asks for
  it): here that stretched and flickered textures and cost 30 to 45 ms a frame.
- F1: HARDWARE RAY TRACING (TRIAL); play scripts: -HardwareRT (frame generation left off with it,
  as with -RayTracing); launcher: a checkbox. Docs: fork-ray-tracing.md, README.md, switches.md.

One PC (RTX 4070 12 GB, driver 621.40, Series X profile, no frame generation): 22 to 25 frames a
second against 6 with -RayTracing; the run ended after six minutes with the card's memory full.

Co-authored-by: dakisback2 <90546900+dakisback2@users.noreply.github.com>
Co-authored-by: Leslie-d-a <70692092+Leslie-d-a@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 23:04:12 +01:00
1fff691295 Merge pull request #2873 from kirigayakazima/fix/d3d12-clippy-workspace-clean
d3d12: fix remaining workspace clippy warnings
2026-12-01 21:54:04 +01:00
60f7dcd904 Merge pull request #2826 from enlight3d/reaper-bounded-queue
D3D12-REAPER-BOUNDED-QUEUE: bound the reaper's line (LEONIDA_REAPER_LIMIT)
2026-12-01 19:37:13 +01:00
9f0d351cc8 Merge pull request #2880 from alpfilho/d3d12/menu-last-choice-wins
d3d12: the last choice wins between the command line and the F1 menu (D3D12-MENU-LAST-CHOICE-WINS)
2026-12-01 18:38:35 +01:00
597e2d9226 Merge remote-tracking branch 'origin/main' into reaper-bounded-queue
d3d12/docs/switches.md regenerated with tools/d3d12_switches.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:30:24 +01:00
7be7711c8e Merge remote-tracking branch 'origin/main' into reaper-bounded-queue
d3d12/docs/switches.md regenerated with tools/d3d12_switches.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:12:31 +01:00
fe612066ac gpu: drop neon green and blue garbage from the probe resolve on request
The light pass already drops magenta from what the title's probe resolve
left (LEONIDA_AMBIENT_MAGENTA, on). LEONIDA_AMBIENT_GREEN=1 drops a green
far above red and blue, LEONIDA_AMBIENT_BLUE=1 a blue far above green and
above red, with the thresholds of lobomfz/VIctory-xmem 5a60834 (from
coastingVI via dfmbrollins/victory-linux-nvidia, GPL-3.0).

Both are off by default: the garbage was seen on Linux with RADV, not yet
on a Windows driver, and a strongly green or blue light that is real would
be dropped too. A new test compiles the part with every drop on and off;
it fails when a define the shader reads is missing.

On an RX 6800 (Windows 11, driver 32.0.21030.2001) with both on, a
save loaded into the world: the light passes were made with the drops
compiled in, and the picture showed nothing wrong over about 4 minutes.
No frame was compared with them off.
2026-12-01 12:02:15 -05:00
c648ec4bdf Merge remote-tracking branch 'origin/main' into fix/ahead-split-kept-thread
# Conflicts:
#	d3d12/docs/switches.md
2026-12-01 17:03:17 +01:00
49ef42d706 Merge remote-tracking branch 'origin/main' into reaper-bounded-queue
d3d12/docs/switches.md regenerated with tools/d3d12_switches.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:30:27 +01:00
51fbf718ba The write-combined part of a mixed copy is left out of the copy-back by default (LEONIDA_WC_SUBRANGE_NO_BACK on): the card and the submitting thread 1 ms a frame lighter each
- shadow.rs: wc_subrange_no_back (f85d1790a, by hardly-relevant) is on
  unless LEONIDA_WC_SUBRANGE_NO_BACK=0. The copy the compares behind
  submissions go over most, 147 MB of the 32-bit graphics heap four times a
  frame, spans its 47 MB write-combined part (0x2404) and its 100 MB cached
  one; the whole-copy rule (LEONIDA_WC_NO_BACK) never took it.
- findings.md: the measurements.

Standing at the waterside save, Series X, 1,080 to 1,440 lines, no
generated frames, by turns of 4 s (run d317, 55 phases): the card busy
-0.99 +-0.40 ms a frame, the submitting thread -0.99 +-0.40, the frame's
median -0.68 +-0.61, means -0.48 +-0.68. Recorded tour (d318, 581 frames):
49 frames with one-frame cells, 79 cells, all where the camera swings, as in
the tours before; nothing torn.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the runs
above; cargo check with diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:23:47 -05:00
ecaa291d5b Title memory windows' line in card memory the CPU maps can be set (LEONIDA_WINDOWS_BAR_LINE, 80 by default); notes on windows up to 6 GB and the paired form for the heaviest passes
- shadow.rs: window_mapped_for stopped making windows in card memory the
  CPU maps at 80 hundredths of the card's budget, a fixed line. On this PC,
  where other programs held 4.4 GB of the 16 GB card, the line kept 1.7 GB of
  windows in the PC's memory with a 6 GB cap (run d314).
  LEONIDA_WINDOWS_BAR_LINE sets it (50 to 97), to measure what those windows
  cost read over the bus. Nothing changes without it.
- findings.md: windows up to 6 GB (d314: 39 more windows there, the line
  stopped the rest; PCIe 3.9 GB/s received and 5.1 sent at the median), and
  the paired form for 16 of the heaviest single compute passes (d312 against
  d316: no clear gain, not taken).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the runs
named; cargo check with and without diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:22:40 -05:00
7d482d644d Merge remote-tracking branch 'origin/main' into fix/d3d12-depth-bounds-test-flake 2026-12-01 06:54:21 -08:00
955e7d9cf2 Indirect batches stay open past programs that only read through views picked from the heap, by default: 928 clamp passes a frame become about 180, the card 3.7 ms a frame lighter
- draw.rs: LEONIDA_BATCH_HEAP_READS is on unless set to 0. stores_bound
  already says no of every store through a picked view, so the extra rule
  only kept batches from staying open past programs that read through
  picked views: the 934 CS_RaytracingResolve dispatches a frame (and the
  meshlet culling passes, which store their records through views their
  binds declare and now end a batch for those records alone).
- findings.md: the measurements; switches.md regenerated (with the
  switches of the main commits merged before).

Standing at the waterside save, Series X, 1,080 to 1,440 lines, no
generated frames: 175 to 186 batch passes a frame against 928 (run d311
against d275, LEONIDA_BATCH_WHY), 8 of them ended for stores not declared
(793 before). By turns of 4 s (run d310, 53 phases): the frame's median
-2.11 +-0.69 ms, means -1.86 +-0.86, the card busy -3.67 +-0.43, the
submitting thread +0.48 +-0.73. Timing run (d312): the card's timed work
60.5 ms a frame against 63.2. Recorded tour (d313, 520 frames): 37 frames
with one-frame cells, 67 cells, all in fast turns, at the low end of the
tours before; terrain, foliage, the house and the player drawn.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the runs
above; the batched clamp's WARP tests; cargo check with and without
diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:49:17 -05:00
c8eea9466f d3d12: the last choice wins between the command line and the F1 menu (D3D12-MENU-LAST-CHOICE-WINS)
play-nvidia.ps1 applied leonida-settings.txt (what F1 saved) over the command line at every start. An empty value
there removed what the command line set, so a later -Resolution, -Dlss or -SeriesS was lost without a word.

Now leonida-launch.txt (git-ignored) keeps what the last start's command line made:
- A setting this command line makes otherwise than that start's did wins. The menu file drops its value, so F1
  shows and saves the new one.
- A setting it makes as before keeps the menu's value, the newer choice.
- Each start says which values came from the menu and which the command line replaced.
- A dry run writes neither file.

The F1 menu gets the native render scale (1, which -Resolution makes at the output's height) and the dynamic
resolution's lowest scale (LEONIDA_RENDER_SCALE_MIN, from -Lowest).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:16:56 -03:00
4b52062d54 d3d12-gpu: stabilize global stall routing test under parallel diagnostics runs 2026-12-01 17:16:04 +03:00
19d3484d71 Indirect batches can stay open past programs that only read through views picked from the heap (LEONIDA_BATCH_HEAP_READS, off), and the batch pass reads its job, count and budget at once
- draw.rs: with LEONIDA_INDIRECT_BATCH=4 a program that picks buffer views from
  the heap by an index it computes ended every batch of indirect records, even
  when every store it makes goes through views its bind declares (it may only
  read through the picked ones). stores_bound already says no of a store
  through a picked view, so with LEONIDA_BATCH_HEAP_READS=1 such a program is
  asked like any other. The 1,004 CS_RaytracingResolve hit programs are of that
  kind, and the batch count a frame (900 to 1,000) follows their 934
  dispatches. Off by default until measured; nameable in LEONIDA_AB. The
  LEONIDA_BATCH_WHY line names 16 programs, not 8.
- indirect/batch.rs: the pass read the job table's count, then the job, then
  the budget by an atomic or, then charged it by compare and exchange: four
  trips to memory one behind the other, about 930 passes a frame. The count,
  the experiments' bits, the job and the budget are read together now, and a
  pass whose jobs fit in one group and all fit in what is left of the budget
  (it is then the only group charging it, after every earlier shader write)
  adds them with one atomic it does not wait for. Otherwise it charges as
  before. What it writes and charges is the same.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the batched
clamp's WARP and card tests (budget charging, cut dispatches, the clamp of one
execution against the batch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:06:17 -05:00
57484f6912 Merge remote-tracking branch 'origin/main' into push/main-1130 2026-12-01 08:35:40 -05:00
a6f835ef0f Merge remote-tracking branch 'origin/main' into reaper-bounded-queue
d3d12/docs/switches.md regenerated with tools/d3d12_switches.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 14:23:20 +01:00
65f372c08a gpu: honor coverage on the first masked draw 2026-12-01 08:15:15 -05:00
6fe30fb965 gpu: inline the first constant-buffer slot
RX 6800 Boat and City, 39 matched pairs: 0.48 ms faster per frame.
2026-12-01 08:15:15 -05:00
357c710231 gpu: reuse constant-buffer fills
From TheGeogeo #2850. RX 6800 Boat bridge: 17.08 to 17.47 FPS.
2026-12-01 08:15:15 -05:00
b4d3289011 gpu: send prepared lists in order
From foxhound 662ed959. RX 6800 Boat, 43 matched pairs: 0.60 ms faster per frame.
2026-12-01 08:15:15 -05:00
7feda433d0 d3d12: fix remaining workspace clippy warnings 2026-12-01 21:01:29 +08:00
2cb6bdd45b The title's barrier on a depth texture also waits for its depth plane's twin
A depth texture with a stencil plane has two host twins that shaders write through unordered access: the
colour twin and the depth plane's (`resource::twin_plane_resource`). The title's unordered access barrier
on the texture was put on the colour twin alone, so a pass reading what was written through the depth plane
could read it unfinished, or the frame before's. The tiled lighting writes its material classes that way,
and the deferred lighting then shaded tiles with the wrong class: a dark patch with blocky edges on a wall.
The barrier is now on both twins.

After KyleS98/VIctory-Neo d533ce6, taken there from sub-north/Subsystem 664d7ec6 ("Wait for a depth plane's
twin in a UAV barrier", GPL-3.0); its tracer (gtport646, RTX 4090) saw the patch in 2 launches of 5 before
and in none of 25 after.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: type-checked; a recorded tour after it
(the patch is too rare to count out in one).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 07:56:37 -05:00
dd4829ecfc Merge remote-tracking branch 'origin/main' into push/main-1130
# Conflicts:
#	d3d12/docs/switches.md
2026-12-01 07:52:21 -05:00
b0306ef421 The light stand-in can let near surfaces take its estimate, not stale probe tiles (LEONIDA_AMBIENT_NEAR, off)
Without ray tracing the title's probe resolve leaves stale tiles of 16x16 where its probes found nothing,
and the light pass's last step kept the larger of those and its own estimate: a mosaic on faces and hair.
With `LEONIDA_AMBIENT_NEAR=1` near surfaces take the estimate, and past 100 m what was there comes back,
fully by 250 m, for the sky's light. After DoubleGhosty/cool_fox b0906d4 (NoLogicAlan's fix of its issue
#151, GPL-3.0), without that commit's other clamps (Leonida's passes cap what was there by the estimate
already). Off by default until a recorded tour shows faces and hair with and without it.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: type-checked; tours with and without it
to follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:52:30 -05:00
d905b003ca On NVIDIA cards, max/min/med3 and the legacy product in the card's own forms, checked to the bit on the card
Ported from KyleS98/VIctory-Neo e23accf, itself from readmet3xt-lab/foxhound 9b11fac5 ("Shaders on
NVIDIA: max/min/med3 and the legacy product in exact host forms", VICTORY_HOST_FLOAT), GPL-3.0, as
Leonida code.

The console's v_max/v_min (which order -0 below +0), v_med3 between two constants and the legacy
product (0 times anything is 0) were spelled out for every host but AMD's RDNA cards, in four to seven
operations each. On an NVIDIA host (`set_host_nvidia`, from the device's vendor) they are now the host's
FMax and FMin, a minimum of a maximum, and a product with one compare of its factors, as the RDNA forms
were already (`host_rdna` gives `host_float`'s bits there). The legacy product asks its factors whether
one is 0 even where they are bounded (`rdna::ZERO_SIGN`), so its zeros are the hardware's +0; Leonida's
legacy multiply-add keeps its spelled-out form there (its RDNA shortcut was checked on RDNA only).
`LEONIDA_HOST_FLOAT`: a set of the bits (1 max and min, 2 the legacy product, 4 med3, 16 the zero asked
of the factors); unset: all four; `0`: as before. Part of the translation: the shader cache keys on it.

The fork's measurements: on an RTX 4070 SUPER some programs ran several times slower in the spelled-out
forms (a gather of local lights 5.0 -> 1.2 ms, a tiled lighting pass 4.1 -> 0.2) depending on where the
system put memory, as a spilling program's would; on an RTX 3090 Ti 33.3 -> 33.9 frames a second.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64:
host_forms_give_what_the_spelled_out_ones_give on the card (13 forms, 169 cases each with zeros of both
signs, a subnormal, infinities and NaN: the same bits as the spelled-out forms), the legacy tests;
timed in a run of the game after this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:49:04 -05:00
4501780d27 Merge remote-tracking branch 'origin/main' into perf/d3d12-gpu-list-lock-contention 2026-12-01 02:57:06 -08:00
c77b84e3a0 D3D12-CLIPPY-LEONIDA-GPU: fix all 52 clippy warnings in leonida-gpu (#2682)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-12-01 11:39:04 +01:00
653f60d37e Merge pull request #2699 from bobcatchris/feat/d3d12-gpu-shadow-avx2-merge
D3D12-GPU-SHADOW-AVX2-MERGE-AND-RUNS: AVX2 fast paths for shadow merge, back_piece, and changed_runs
2026-12-01 11:18:41 +01:00
da56079c9e Merge pull request #2689 from bobcatchris/feat/d3d12-gpu-changed-records-avx2
D3D12-GPU-CHANGED-RECORDS-AVX2: add AVX2 fast path for 32-byte descriptor changed_records
2026-12-01 11:07:51 +01:00
3393ceec9c Merge pull request #2696 from bobcatchris/feat/d3d12-gpu-texback-reuse-before
D3D12-GPU-TEXBACK-REUSE-BEFORE: reuse thread-local before buffer in texback::write
2026-12-01 10:51:22 +01:00
7fbcd456e5 Merge pull request #2705 from Kal0s-design/fix/removal-context-in-air
d3d12: say how many submissions were not yet seen finished when the device went (D3D12-REMOVAL-CONTEXT-IN-AIR)
2026-12-01 10:24:42 +01:00
c4e286fdfa d3d12-gpu: physical-page writes reach every view heap's texture pass
Writes behind the guards' back (DirectStorage reads into physical pages)
were kept in one list, and so were the ones retained for one-shot bakes.
The first view heap whose texture pass ran took the whole list, so when
the title binds more than one view heap the placed textures of the others
kept the bytes from before. The remapped ranges already have a cursor per
heap (RemapQueue); the page writes now get the same treatment: a list per
view heap that holds placed textures (made at its first placed texture,
taken out when the heap goes), and a bake list per heap.

After TaynanGT's fix in TaynanGT/Vice-Tay (bc44a9f).

Co-Authored-By: TaynanGT <157688638+TaynanGT@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:20:35 +01:00
2451b47447 gpu/pool/small: release pool mutex during CreateHeap block growth 2026-12-01 09:37:54 +01:00
aefb250844 Merge remote-tracking branch 'origin/main' into push/main-1130 2026-12-01 01:28:25 -05:00
6479135328 The precompile's store runs on as many threads as its processes, and notes each pipeline by what the library holds
The driver's own cache on disk does not keep all that the precompile's processes compile: of 400
pipelines a precompile had just made (run d287's), 116 were compiled again by the next process to ask
for them (138 s in all; the other 284 took about 2 ms each), with the launcher's own settings and with
none alike. That is why the game compiled some 1,700 pipelines in the world right after a precompile,
and why the store's one thread took over nine minutes for its first thousand (run d288, stopped). It now
works on as many threads as the precompile has processes (8 on a 12-thread CPU), as the game's pipeline
workers do; whether each pipeline ended in the library (loaded from it, or made and stored) is taken
from the library call itself, not from counters other threads move too. A store that ended badly twice
for one translation is not tried again for it (`library-failed.txt`).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: type-checked; the same 30 and 400
pipelines timed as a precompile worker, as the store with the 1.6 GB library and with an empty one
(each stopped before writing); checked in a run of the game after this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 01:13:46 -05:00