Commit Graph

18350 Commits

Author SHA1 Message Date
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
3bf2844a5d Merge pull request #2835 from bobcatchris/fix/d3d12-shader-ir-analyse-once
D3D12-SHADER-IR-BUILD-ANALYSE-ONCE: decode instruction fields and effects once
2026-12-01 10:09:25 +01:00
76746d35b8 Merge pull request #2836 from Kal0s-design/fix/xmem-arrange-stale-owner
d3d12-hle: arrange forgets the slice a page leaves for an unowned one (D3D12-HLE-XMEM-ARRANGE-STALE-OWNER)
2026-12-01 09:55:44 +01:00
ad7c62edbd Merge pull request #1524 from jarvixaiassistant-glitch/fix/decode-ds-llvm-parity
rdna2_decode: align DS single-offset and ds_swizzle_b32 ROTATE/FFT formatting with LLVM (DECODE-DS-PARITY)
2026-12-01 09:39:30 +01:00
2451b47447 gpu/pool/small: release pool mutex during CreateHeap block growth 2026-12-01 09:37:54 +01:00
acae5b8797 shader/emit: cache immediate sampler handles in entry block 2026-12-01 09:37:54 +01:00
ce91bce594 shader/opt: extend Module::bounded() to zero-identity Add/Sub and budgeted acyclic Phi 2026-12-01 09:37:54 +01:00
60ef5bd2e4 shader/lower: preserve builder_bounds root header size guard when WIDE loads are enabled 2026-12-01 09:37:54 +01:00
2095f63086 Fix exporter stdout encoding on Windows 2026-12-01 12:30:21 +04:00
cd73ddab7b Merge remote-tracking branch 'origin/main' into push/main-1130 2026-12-01 03:18:05 -05:00
10d8223336 Notes: join parts 8 against 4, and legacy multiplies as plain products, measured
findings.md: 8 parts of submissions joined against 4 by turns (run d296, 112 phases; ImTaneax/VIctory-RTX3050-4gb
2b3030f joins at most 4 there): the frame the same, the submitting thread 3.18 +-0.32 ms less with 8, so 8 stays.
LEONIDA_LEGACY_PLAIN=1 in timing runs with every pipeline from the library (d294, d297): 51.82 -> 51.25 ms of the
card's timed work, within what two runs of one build differ; left off.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs d294, d296, d297 (Series X profile, 1440p
output, dynamic resolution from 1080 lines, frame generation off).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 03:18:03 -05:00
2e822df666 Merge pull request #2803 from thiefyzheng/test/w64-append-consume-barrier
W64-APPEND-CONSUME-BARRIER-REGRESSION: guard one-wave branch barriers
2026-12-01 09:17:52 +01:00
1d73465e88 Merge pull request #2818 from imShangLi/fix/argparse-gpu-probe-list
test_make_game_argparse: the shaders stage probes two GPUs the test does not mock
2026-12-01 09:01:51 +01:00
501b3e6c5c Merge pull request #2805 from TheGeogeo/d3d12-gate-pwsh7
gate: game-gate.ps1 says it needs PowerShell 7 (D3D12-GATE-PWSH7)
2026-12-01 08:50:36 +01:00
d9c470cd30 game_run_summary: record the run cgroup's memory peak 2026-12-01 08:41:52 +01:00
e56aff1ce4 Merge pull request #2846 from MoonEyes/fix/game-gate-warm-words
game_gate: the precompile's line names the notes by mark (D3D12-GATE-WARM-WORDS)
2026-12-01 08:41:11 +01:00
5df6760122 game_gate: the precompile's line names the notes by mark (D3D12-GATE-WARM-WORDS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 08:27:52 +01:00
9372a4d4fd Merge remote-tracking branch 'origin/main' into push/main-1130 2026-12-01 02:11:15 -05:00
adb8ea4741 Notes: the precompile's notes per executable name, measured
findings.md: library loads as each name (43 s, then 16 s, as leonida_sm.exe; 28 s as leonida.exe for the
same 400), the storm of run d291 with notes by translation alone, and run d293 after the change (4,875
loaded through the library in 61 s; the world at 74 to 110 ms a frame, none loading after two and a half
minutes).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs d291 and d293 (Series X profile,
1440p output, dynamic resolution from 1080 lines, frame generation off).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 02:11:13 -05:00
d696c86509 rdna2spirv: fix quad_any's other stale partial-quad wording 2026-12-01 08:04:17 +01:00
410fb011ea The precompile notes what it made per executable name, and fills a name's driver cache from the pipeline library
The driver keeps a cache on disk for each name a process runs under, and the launcher runs the game as
`leonida_sm.exe` (its Smooth Motion copy) when frame generation is off. `warm-done.txt` noted pipelines by
the translation alone, so after a precompile as `leonida.exe` a start as `leonida_sm.exe` made nothing,
and its world came up with some 1,700 pipelines still being loaded from the library, 5.4 s a frame
(run d291, stopped), where a start as `leonida.exe` had none (d292). A load from the library is quick
once the name's cache has seen the pipeline: 400 loaded as `leonida_sm.exe` took 43 s together the first
time (90th percentile 214 ms) and 16 s the next; as `leonida.exe` 28 s.

The notes are now per name (`<fingerprint>-<name>`; `leonida.exe` keeps the bare fingerprint, so what it
noted stands). Pipelines in the library already are not compiled again for another name: the store loads
them under that name, which fills its cache (with --again, after the cache was emptied, all of them).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: type-checked; library loads timed as
both names (above); checked in a run with frame generation off after this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 02:01:33 -05:00
0d41b0a0c0 Merge pull request #2639 from breachato/meshlet-page-shared-report-path
meshlet_page: ask report_paths for the report-path guard
2026-12-01 08:01:18 +01:00
7b06905c87 docs/port_status.md: wrap the device-loss paragraph
AI-assisted.
2026-12-01 07:54:06 +01:00
8e0594344c docs/port_status.md: name the call that first returned device lost
run24's loss came from vkWaitSemaphores; run25's from vkQueueSubmit
before vkWaitSemaphores. The paragraph attributed both to run24.

AI-assisted.
2026-12-01 07:53:14 +01:00
f918e51457 Merge pull request #2810 from TheGeogeo/d3d12-gate-memory-peaks
gate: summary.json gets the run's memory peaks (D3D12-GATE-MEMORY-PEAKS)
2026-12-01 07:44:59 +01:00
4edb90521b game_run_summary: keep the breakpoint when the guest also exited 3
A startup-trace exit event with code 3 no longer hides a title
breakpoint; a device loss still takes precedence when it is the only
explanation, because the breakpoint is its handler.

AI-assisted.
2026-12-01 07:36:57 +01:00
74e3be90c0 game_run_summary: let a guest exit win, and match any breakpoint code
A device-lost line written during teardown no longer renames a clean
guest exit or a time limit. The breakpoint check now looks at every
exception code, normalised for 0x and case, so a later teardown fault
does not hide it. The docstring says the [rt] lines are the C++ runtime's,
not the native Rust runtime's.

AI-assisted.
2026-12-01 07:35:45 +01:00
035da4fa9d docs/boot.md: label the made pipeline pair and the counters' preconditions
The pipeline row now cites the made pair for "made", not the live
counts; the table says the mem-probe rows need LEONIDA_MEM_PROBE at the
start, submit frame needs LEONIDA_SUBMIT_FRAME_SECONDS, and the [rt]
lines are the Vulkan layer's stderr. Retitle the section to three stops
and name the device-loss/watchdog lines and the at device loss reason.

AI-assisted.
2026-12-01 07:35:40 +01:00
f589493c5f docs/port_status.md: scope the second machine's list-values runs
Move the runs out of the 2026-11-25 boot section into their own dated
section, name the build and driver, say how many runs each configuration
has, keep "draws further" with run24 only, and report cgroup memory.
Scope the two test-machine statements that said the title stops before
its first frame.

AI-assisted.
2026-12-01 07:35:33 +01:00
5ef76aa9aa docs/running.md: say cgroup memory for the measured 19-20 GB
The runs report the cgroup's peak, as the RUN blocks do; the VRAM
spilled to host memory is a different figure.

AI-assisted.
2026-12-01 07:35:25 +01:00
aefb250844 Merge remote-tracking branch 'origin/main' into push/main-1130 2026-12-01 01:28:25 -05:00
b024e59403 Notes: why the game compiled the precompile's pipelines again, and what was done; the switch list regenerated
findings.md, under the static samplers: the two causes (the precompile's processes had no sampler
places; the driver's cache on disk does not keep what the precompile compiles, about 30 % lost), the
measurements (the card test, 116 of 400 compiled again, run d287's 1,700 in the world, run d289's 3,540
loaded and 74 made after the store), and that forced stops of test runs write neither cache.
switches.md: LEONIDA_WARM_LIBRARY, LEONIDA_NO_WATCHDOG's default, and main's
LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: runs d287, d288, d289 (Series X
profile, 1440p output, frame generation on).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 01:28:22 -05:00
555a8f7a18 game_run_summary: name device lost and title breakpoint in the END words
The summary called a device loss and the title's own int3 both
"process exit 3, no exit event". Use the RUN block's END words: the
runtime's device-lost line becomes "device lost", and exit 3 whose last
exception is 0x80000003 becomes "title breakpoint".

AI-assisted.
2026-12-01 07:18:51 +01:00
57d5c000ee docs/boot.md: tell a compile stall, a held value and host memory apart
A run that ends after the first frame now has a short table of the
[rt] lines to compare: mem-probe's made-pipeline count, list values'
oldest held gate, and the cgroup peak, with the measured shapes from
#2464. Links the gate rule in d3d12_xs_console_abi.md instead of
repeating it.

AI-assisted.
2026-12-01 07:16:28 +01: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
c7c82150b1 docs/port_status.md: the measured list-values pair past the world load
The device-loss paragraph now has the measured reproduction on a 12 GB
NVIDIA card: with the list values on, the opening sequence's night scene
waits in one console value for 101 minutes; with LEONIDA_LIST_VALUES=0 it
draws further and ends in the title's device-removed handler, with no
fault address. Links the two #2464 run comments.

AI-assisted.
2026-12-01 07:13:30 +01:00
6b6f75abbb docs/running.md: source the Linux + Wine + NVIDIA details and index the profile
- separate the 22.2 GB run that drew the city night street from the
  22.3 GB default-arena run, as the reports do;
- say the 1.7 GB journal was warm from three earlier runs, not filled by
  these runs;
- replace the unsourced scene names and the submissions-per-frame count
  with the reports' words, and give the 47 s STRAY_RO_HEAL observation
  its provenance;
- say that 724 is the maintainers' count and 723 is this pack's, that
  the skip list takes name fragments and is the ray-tracing programs;
- give the full run_game_wine.sh invocation and name the local trace-off
  change;
- index the profile in docs/README.md and point linux_proton.md at it.

AI-assisted.
2026-12-01 07:11:10 +01:00
d22cd3b6bb The precompile puts its pipelines into the pipeline library, which the game loads them from
The precompile (`leonida warm`) left the pipelines it made to the driver's own cache on disk, and the
game's runs did not take them from it: right after a precompile that had made them, 1,100 to 2,300
pipelines were "being made" in the first world frames (runs d257, d285, d286, d287), compiled again at
a few to thirty a second while frames took 2 to 10 s (the launcher waits up to 10 s a frame for a
pipeline), and in d287 none of the driver's cache files was written in the four minutes the game
compiled 1,700 pipelines. The game loads pipelines from the pipeline library (a run of 2026-11-27:
2,338 loaded, none made), which it writes only at a run's normal end, and the library on this PC was
last written on 2026-11-29: every change of the translator since meant minutes of compiling in the
world at the next start.

After making them, the precompile now puts those of this translation that are not in the library yet
into it, in one process of its own (`warm --store`): with the library and the static sampler list in
use before its device is made, as the game has them, each pipeline is loaded by the name the game looks
it up by or made (from the driver's cache the processes before filled) and stored; then the library is
written. They are noted in `library-done.txt` only once it is written; a store that fails leaves things
as they were. `LEONIDA_WARM_LIBRARY=0` leaves the library alone, as before.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: type-checked; checked in a run of the
game right after this commit (see the next one).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:51:55 -05:00
8b89520b13 docs/running.md: a Linux + Wine + NVIDIA profile that draws world frames (DOCS-RUNNING-LINUX-WINE-NVIDIA)
The page has Linux RADV, a Proton NVIDIA report and Windows sections, but no Linux + Wine + NVIDIA
profile. This one is a desktop RTX 3060 12 GB with Wine 11.22: it draws the first-run UI at 30 frames/s,
loads the story and draws the opening sequence's prison yard, city street and carnival scenes at 1-3
frames per 10-16 s, with host memory at 19-20 GB and up to 23.6 GB.

The section carries the build, shader pack, environment (including LEONIDA_STRAY_RO_HEAL=1, without which
a run ends at 47 s here) and what to expect, and names the two ends of the carnival scene as known
problems: a console value wait held for 101 minutes with the list values on, and a device loss with
LEONIDA_LIST_VALUES=0. Every value comes from the RUN blocks posted on #2464, which the section links;
no game data is added.

AI-assisted.
2026-12-01 06:47:56 +01:00
640b0d0df8 Merge pull request #2802 from bobcatchris/perf/d3d12-gpu-texture-digest-aes
D3D12-GPU-TEXTURE-DIGEST-AES: hash a texture's memory with AES rounds (23.6 -> 108-139 GB/s in cache, 2.9x from memory)
2026-12-01 06:34:39 +01:00
1fc92830bf Merge pull request #2709 from Kal0s-design/fix/safecopy-guard-rearm
d3d12: a guard page fails a copy and stays a guard page (D3D12-GPU-SAFECOPY-GUARD-PAGE-REARM)
2026-12-01 06:22:15 +01:00
9ddc22e99c Merge remote-tracking branch 'origin/main' into push/main-1130 2026-12-01 00:21:36 -05:00
43489ce3bd The title's watchdog is quieted by default: a stall of its main thread past 30 s is not ended as a crash
The loader's watchdog patches (from leonida-perf, after ZigZagBoi1/ScarlettPort) were opt-in
(`LEONIDA_NO_WATCHDOG` set); they now apply unless `LEONIDA_NO_WATCHDOG=0`. Each is still checked
against the 1.0.2.1 build's hash and the bytes it replaces. The title ends its process by a write to
address 0 when its main thread has not advanced for 30 one-second ticks, which a long load or the
driver compiling can reach on a PC.

Default on as trustno1-coder/VIctory-NVIDIA aee4c45a (through KyleS98/VIctory-Neo b686df1, GPL-3.0)
quiets the title's watchdog by default; those set the watchdog's own quit flag twice a second, the
patches here skip its fault instead.

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the loader's
the_watchdog_is_quieted_unless_told_not_to test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:21:36 -05:00
c3cf5f4fcc The precompile makes its pipelines at the game's static sampler places: the world no longer compiles them again
The game makes the static samplers listed beside the pipeline library at fixed places in the driver's
table when its device is made (pipeline/places.rs), because a compiled pipeline holds those places and
the driver's cache on disk keys on them. That happened only where the library's folder was set, which
`leonida warm`'s processes never set: their samplers took the places their first pipelines gave them,
so the driver kept what the precompile compiled under other places than the game's pipelines have, and
the game compiled them all again in the world. After a precompile that had just made them, 1,100 to
2,300 pipelines were "being made" in the first world frames (runs d257, d285, d286); in d285 and d286
frames took 4 to 10 s for minutes, with up to 3,000 draws a frame dropped for want of a pipeline
(missing objects, flashes), until the run was stopped.

The precompile's processes now read the same list (`places::use_list`, from
`known::use_translations`) and make its samplers first, as the game does; they write nothing to the
list and keep no library (the driver makes their pipelines, and its cache keeps them for the game).
`what_a_precompile_makes_the_game_finds_in_the_drivers_cache` measures it on the card, in processes of
its own: precompiled with the list, a compute and a graphics pipeline took 11.0 and 4.4 ms and the
game's run then 1.1 and 0.8 ms (from the driver's cache); precompiled without it, 12.8 and 4.5 ms and
the game's run 9.0 and 5.3 ms (compiled again).

AI-assisted (Claude). Tested on RTX 4060 Ti 16 GB, driver 616.64: the pipeline::places tests on the
card (8 passed, the new one included).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:21:36 -05:00
3b5e702f83 d3d12-hle: arrange forgets the slice a page leaves for an unowned one
In xmem's arrange (renderer port 1, the 32-bit heap's slices in address
order), a page moving to a slice that no page has left its own slice
still recorded as its own in the owner map. A later page of the same
call moving into that slice then found the first page there and swapped
it back, so the first page lost the place it had just been given. The
slice it leaves now has no owner.

Ported from ahmetbagci's fix in Vice-Tay (fddf8c7).

Co-Authored-By: ahmetbagci <6625856+ahmetbagci@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 06:10:33 +01:00
12ff308a83 d3d12-shader: decode instruction fields and effects once in ir::build
For a program with v_writelane_b32/v_readlane_b32, unspill has to walk every
instruction to find parked scalars, decoding fields and computing effects for
each, and then build walks them again doing both. unspill now returns a cache
indexed by instruction (name, fields, effects), and build takes it.

The cache is sound because unspill only rewrites list in place and only after
it has already scanned everything; any instruction unspill rewrites has its
cache entry cleared, and build recomputes effects after its own
parked-scalar substitution. Programs without a lane save or restore, and any
program where unspill_scan bails, get no cache and decode exactly as before.

Same values, same errors, same order. DXIL-identity over the full shader
archive needs game files; checked here with the leonida-shader unit tests and
the hand-written translator semantic suite.

AI-assisted: yes
2026-11-30 23:02:53 -06:00
10bed9ff28 Merge pull request #2766 from Kal0s-design/fix/sampler-heap-2048
d3d12: give host sampler heaps every slot the shaders can reach (D3D12-GPU-SAMPLER-HEAP-2048)
2026-12-01 05:53:28 +01:00
5dd6d444f0 Merge pull request #2589 from MoonEyes/port/nv-vram-target-reserve-settle
Render-target reserve expires once the targets settle (LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS, off by default)
2026-12-01 05:36:03 +01:00
cb1f3acf9b Merge remote-tracking branch 'origin/main' into push/main-1130 2026-11-30 23:30:27 -05:00