Commit Graph

9534 Commits

Author SHA1 Message Date
f806537a8c gate: summary.json gets the run's memory peaks (D3D12-GATE-MEMORY-PEAKS)
Testers could not use the gate daily without memory figures, and a memory pile-up took a 3090's Windows
down twice. The parser now reads the runtime's memory line and video memory line (every 5 s in builds with
diagnostics) and writes a memory block: the private bytes at their most and when, the most of them in
physical memory, the least the PC had left to commit and when, the card's video memory in use at its most
and when with the budget then, the seconds over that budget, and the most shared memory in use. The video
memory is what the system counts for the process, so it works on any card. The five runtime strings it reads
join the contract test.
2026-12-01 01:32:36 +01:00
f4c6aca754 gate: game-gate.ps1 says it needs PowerShell 7 (D3D12-GATE-PWSH7)
Under Windows PowerShell 5.1 the gate failed in about 2 s without starting the game and without saying
why (reported by a tester). A #Requires -Version 7.0 line makes 5.1 refuse it with a message before
anything runs; docs/game_gate.md says so, and a test keeps the line.
2026-12-01 01:28:02 +01:00
8aada4fc2d Test append/consume barriers in one-wave branches 2026-12-01 00:14:52 +00:00
4929a0e99d Merge feat/live-prompts: button prompts follow a device switch during play 2026-11-30 18:48:36 -05:00
9dffbe7212 Merge pull request #2792 from aznohonza/fix/runtime-install-keep-recovery
make_game: keep recovery copies until an install succeeds (RT-INSTALL-KEEP-RECOVERY)
2026-12-01 00:08:03 +01:00
3c5c86d1ac tests: expect the integer gather low-half extract
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-30 22:40:12 +00:00
2878a3911c Merge pull request #2787 from TheGeogeo/test-red-green
scripts: red_green.py checks a pull request red and green locally (TEST-RED-GREEN-LOCAL)
2026-11-30 23:33:36 +01:00
ac58ddc504 fmisc_diff: do not judge the class bits of a NaN whose quiet bit is unmodelled
A fuzzed sNaN through v_fmamk_f32 into v_cmp_class_f32 flipped a result
bit on both Vulkan GPUs against the reference model. The model returns a
canonical quiet NaN for v_fmamk_f32, but on gfx1036 under the game's MODE
the hardware mostly returns the NaN source's word and only sometimes
quiets a signalling one (f32_hw_s5.log), so whether the result tests as
signalling or quiet is not something the model can know. Track registers
holding such a computed NaN (st["nanf"], set by v_fmamk_f32 with a
signalling or already-fuzzy NaN operand and propagated through the
pass-through ops and register moves) and raise Uncertain when
v_cmp_class_f32 reads one, instead of reporting a mismatch that is a
model gap, not a translator bug.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-30 22:31:48 +00:00
96575316a4 tests: require the actual low-16 extract for integer results
Check offset zero and width 16 on the product and the value stored by the signed sum. Ignore unrelated extracts in the fragment.

AI-assisted with OpenAI Codex (GPT-6).
2026-11-30 22:29:44 +00:00
944d4bd8cf rdna2spirv: emit OpBitFieldUExtract for the VOP3 16-bit result mask (NVIDIA And-&-0xFFFF miscompile)
NVIDIA's shader compiler (RTX 4070 SUPER, wave32) corrupts the preserved
high half of a 16-bit VOP3 result when OpBitwiseAnd & 0xFFFF consumes a
value that passed through %int ops and the result merges with
(old & 0xFFFF0000): v_add_nc_i16 v14, v3, v12 op_sel:[1,1,0] clamp wrote
0x1113AAA8 for 0x0002AAA8. BitFieldUExtract reads the same low 16 bits
and dodges the peephole; SClamp on %int and select-based clamps do not.
AMD (gfx1036, Vulkan and hw_oracle) and the CPU interpreter are
unaffected.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-30 22:29:43 +00:00
41c49ee83c vk_fuzz_run: document and cover crash skips across signal exits
VK_FUZZ_SKIP_CRASH treats every vk_compute_test exit outside 0/1/2/77 as a
driver crash skip, including the negative return codes Python uses for signal
deaths on POSIX. Spell that out in the module contract and cover it beside the
Windows access-violation case so exits 1/2 staying fatal is unambiguous.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-30 22:27:17 +00:00
3bdec8fde3 vk_fuzz_run: --pc-tail-ubo under LEONIDA_PC_TAIL_UBO, VK_FUZZ_SKIP_CRASH for driver crashes
Translate with rdna2spirv.py --pc-tail-ubo when LEONIDA_PC_TAIL_UBO asks for it
(the 1/true/yes/on convention image_fuzz, lds_fuzz and valu_fuzz already use), so
the modules fit a device's 128-byte push-constant range; the variable also
reaches vk_compute_test through the inherited environment.

VK_FUZZ_SKIP_CRASH=1 records a vk_compute_test crash (the AMD Windows shader
compiler's access violation and the like) as a per-program skip instead of
aborting the batch; exit 1 (CHECK failures) and 2 (usage errors) stay fatal,
as does every non-zero exit without the variable.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-30 22:27:17 +00:00
570b441d70 translator: lane-mask data reads gather the wave word under narrowed EXEC
A lane mask in an SGPR, EXEC or VCC is one wave-wide word on hardware.
The EXEC-coverage gate added earlier in this pull request could not prove
the independent-SGPR restore idioms crosslane_fuzz uses, so it fell back
to this lane's 0 / ~0 bit for exactly the programs the read is meant to
fix. It also encoded the wrong control-flow model: EXEC narrowing is a
per-lane value here, not a SPIR-V edge. Mask-data readers are already
kept out of lane-local `if (active)` runs, and the eager wave-mask store
keeps lowering from moving the subgroup gather into an EXEC-selected
arm, so lanes EXEC has off still contribute their mask bits.

Remove the gate and the CFG EXEC provenance analysis it needed, gather
the mask word for every lane-mask data read, and cover narrowed SGPR and
VCC reads, an independent all-ones SGPR EXEC restore, and the composed
vector-bitwise mask words. The vector-bitwise expectations now check the
uniform mask words and the resulting per-lane cndmask bits and popcounts
rather than the old fallback artifact.

Co-Authored-By: SWE-2.1 Max <noreply@google.com>
2026-11-30 22:23:09 +00:00
b3cc377020 translator: s_mov copies of EXEC keep the narrowing's tag through SGPR round-trips
Review follow-up on the mask-word gather gate (#1397): `s_mov_b32 s4,
exec_lo` under an unknown EXEC narrowing recorded nothing for s4, so the
later `s_mov_b32 exec_lo, s4` restore minted a fresh ("n", id) tag in
_exec_src_ex. mask_exec_sigs coverage then failed and the read kept this
lane's 0 / ~0 bit, while the equivalent literal `s_mov_b32 exec_lo, -1`
resolved to a constant half-state and gathered — register and literal
restores of the same runtime value disagreed.

_mov_sgpr_vals now returns an ("al", halves) alias for an EXEC source
whose half-state is an unknown narrowing, the same scheme saveexec uses:
exec_lo gives (state, None), exec_hi (None, state), exec gives each half
in its own register for b64 moves. _exec_src_ex already resolves those
aliases, so the restore reproduces the original tag and the gather stays
exact; untracked SGPR sources still mint a fresh narrowing and stay
conservative.

Tests: two semantic cases (wave32 and wave64) assert the register
round-trip gathers OpGroupNonUniformBitwiseOr identically to the literal
-1 restore; cs_exec_copy.asm (+ fixture, check.py/run_gpu_tests.py dump
entries) stores the mask word, exec_lo's own word and the literal-restore
word side by side on real hardware — PASS on RTX 4070 and Radeon
(64-wide), wave64 exec filters 9/9 on AMD.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-30 22:22:44 +00:00
1725e0818a translator: gate mask-word gathers on EXEC coverage; scalar mask number reads
Review fixes for the mask-as-data change:

- The wave-mask gather is a group op over the lanes EXEC leaves active,
  and drivers differ on whether lanes EXEC has off still vote: NVIDIA,
  AMD and KosmicKrisp return the whole subgroup's bits, MoltenVK's
  ballot/reduce saw only the lanes a narrowed EXEC left on and produced
  the EXEC value instead of the frozen mask word (cs_mask_vgpr_exec).
  mask_word_read_ok now gathers only when a CFG must-analysis
  (mark_exec_state) proves every lane that can hold a set bit of the
  mask is EXEC-active at the read: each EXEC half is tracked as clean,
  a constant mask, or an unknown narrowing (s_mov/s_cselect resolve
  constants, saved-EXEC aliases and unchanged EXEC, so the common
  restore idioms still gather), and mask_exec_sigs records every EXEC
  state seen while each mask register held a mask. Unproven reads keep
  this lane's 0 / ~0 bit, the pre-change answer.
- Scalar number ops read a lane mask operand as data too
  (MASK_NUMBER_READERS, #1043's NUMBER_READERS): s_add_u32 s20, s10, K
  after v_cmp wrote s10 yields the wave's mask word, while mask moves
  and mask logic ops keep this lane's bit for the saveexec idioms.
- wave64_emulate_opt treats ins["mask_words"] (a mask read that will
  gather) as a cross-lane exchange for the lane-local fold planner and
  barrier scheduler, covering the scalar readers as well.
- test_slot67_operand_forms' expectedFailure comes off: the packed
  vcc_hi word now reaches the data read.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-30 22:22:13 +00:00
51b0b9d340 translator: a VALU data read of a lane-mask operand yields the wave's mask word
A lane mask (EXEC/VCC or a mask-tracked SGPR) that a VALU op reads as a
32-bit value — v_mov_b32 of it into a plain VGPR, or any VALU source
where the mask is data rather than a mask operand — materialized each
lane's own 0 / ~0 bit. Hardware holds the whole wave's mask word there
(tools/crosslane_fuzz.py's op_maskdata model: the uniform word written
to the active lanes), so every lane gets the word, the same in each.

- src_u materializes the wave mask word (lane_mask_word) for SGPR and
  EXEC/VCC operands when the instruction's VGPR destination makes the
  read a data read (mask_read_is_data); SGPR/EXEC/VCC destinations keep
  this lane's bit, which mask_src readers rely on. Mask-holding VGPRs
  already store the word, so their reads are plain loads.
- mask_src extracts this lane's bit back out of a mask-holding VGPR
  (_vgpr_mask_lane_bit), half-aware in wave64 via mask_half.
- mask_data_src keeps instructions that materialize the word out of
  EXEC-gated active runs (a subgroup op can't sit inside if (active)).
- v_readfirstlane_b32 of a mask VGPR broadcasts the first active lane's
  copy — the only lane guaranteed fresh after an EXEC-gated v_mov_b32 —
  as the word itself into a VGPR destination (VGPR writes are never
  mask-tracked), or this lane's bit for a mask-tracked SGPR/special
  one; fixes cs_wavemask lanes 48-63.

Found by tools/crosslane_fuzz.py (#293). docs/design.md's whole-wave
mask contract updated.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-30 22:21:36 +00:00
3b45610f9d tests: d3d12_ab_compare's sign rule has a test of its own (D3D12-AB-COMPARE-AGREE-TEST)
"B faster" or "B slower" needs the interval to leave 0 out and all pairs but at most one to agree
in sign. No test caught removing the sign part (the verification of #2783 found it): the odd-run
test's interval already held 0. Eight pairs, two against the rest, now give no verdict, and one
against the rest still does.
2026-11-30 22:55:55 +01:00
0fa9a51ab0 make_game: keep recovery copies until an install succeeds
install_runtime() removed every .runtime-staging-* folder before it
started, including the folder an IncompleteRollback kept as the only
copies of the previous runtime. If the retry also failed, those copies
were already gone. Clean the stale folders only after a successful
publish, so a failed retry leaves the recovery folder in place.

RT-INSTALL-KEEP-RECOVERY.
2026-11-30 22:24:34 +01:00
0b6e0e3bc4 Merge pull request #2782 from TheGeogeo/d3d12-game-gate
d3d12: an in-game gate: one command, one run folder, one summary.json (D3D12-GAME-GATE)
2026-11-30 22:21:34 +01:00
46ea66693f gate: untracked files in run.json, under_2_at_s from 60 s in the world (review)
run.json's dirty leaves untracked files out; a new untracked count says how many there are. The first
second under 2 frames counted from the world's first second, so the arrival's streaming dip was the
run's; it now counts from 60 s in the world, like the median. The longest gap with no frame stays
from the world on: a freeze on pipeline compiles comes right after arrival. The docs say both, and
that world_at_s counts from the gate's start, the precompile included.
2026-11-30 21:58:26 +01:00
1f08a8abb1 scripts: red_green.py checks a pull request red and green locally (TEST-RED-GREEN-LOCAL)
Green is current main with the pull request merged. Red is current main plus only the pull request's
tests: its test files, and the hunks of other Rust files that change only #[cfg(test)] items,
committed on the merge base and cherry-picked with a 3-way merge. It runs the touched D3D12 crates'
cargo test and the changed tests/**/test*.py on both sides, in one worktree and one target dir under
the git common dir, and prints per test: red then green, pass on red and fail on green, fail on both,
on one side only, with a verdict and an exit code. docs/testing.md has it next to the fork-CI recipe.
2026-11-30 21:52:48 +01:00
76b543a097 tools: d3d12_ab_compare reads an A/B of the D3D12 runtime (D3D12-AB-COMPARE)
docs/measuring_fps.md tells how to read an A/B (neighbouring pairs, the
effect with its standard error, ABBA after a throwaway run), but the
scripts it named were never in the repository, and testers' two-run
verdicts turned out to be noise.

`abba` takes runs in the order they ran (folders of scripts/game-gate.ps1
or logs), one value a run (its world median frame time: frames within a
run are not independent), pairs neighbouring runs and gives the mean
difference with its standard error and a 95 % t interval, the median of the
differences and how many agree in sign. It needs at least 4 pairs, as many
with A first as with B first, so a linear drift cancels; with 3 runs a side
it fits the side and a linear trend instead. It says "B faster" or "B
slower" only when the interval leaves 0 out and all pairs but one agree.
Gate runs that did not PASS are left out with their pair.

`phases` does the same inside one LEONIDA_AB run, per switch, for the
median frame time and the `A/B counters` line, leaving out pairs of blocks
whose draws a frame differ by more than a tenth. `plan` prints a balanced
order. Numbers only, never log text.
2026-11-30 20:44:09 +01:00
b535fb0dc3 d3d12: an in-game gate: one command, one run folder, one summary.json (D3D12-GAME-GATE)
Testers ran in-game gates and A/Bs by hand on five machines, each with
their own launcher wrapper and log parsers, and lost runs to consoles and
key files. scripts/game-gate.ps1 runs leonida.exe through the checkout's
play-d3d12.ps1 and writes one folder per run: run.json, launch.ps1, the
-DryRun settings, the F1 settings file, the launcher's output (the
precompile lines nobody kept), the runtime's log, events.jsonl and a copy
of the tester's data template (their own saves are never touched). It
stops the game with WM_SYSCOMMAND/SC_CLOSE (the runtime's own end: suspend,
pipeline cache saved) once -WorldSeconds were spent in the world, on a
STOP file or after -MaxMinutes, and kills it only 60 s later; it keeps the
game's exit code. `start` runs the same detached (created through CIM, so
an agent's or console's end does not end it); `stop` asks a run to end.

tools/game_gate.py (standard library) reads the folder into
summary.json (leonida-gate-summary/1): build, card, settings (the run's
settings line, no paths), precompile counts, time to the world (two frame
lines with 500 draws or more, cutscenes included), when the pipeline
cache went warm (60 s with nothing being made), fps from the presents
(median, p5, frame p95, end median, the first second under 2 frames, the
longest gap with no frame), crashes by kind (device lost, panic, fault by
module kind), exit, stop and a verdict: PASS needs 300 s in the world,
no device loss, panic or fault, no gap over 10 s, alive at the stop. The
testers' answers to a draft on the bridge are folded in. Its tests use
synthetic logs and check that the runtime still writes what it reads.
2026-11-30 20:39:48 +01:00
d99ba5c095 Merge main: drop the macos job as main does, keep this PR's runtime.yml path filters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 20:24:47 +01:00
e9b2529a96 tests: list meshlet_page in SHARED
The reviewers' red test: with this entry on main,
test_switched_tools_import_the_helper_and_define_no_copy fails with
"'from report_paths import same_report_path' not found"; with this branch
it passes.
2026-11-30 19:43:24 +01:00
22d58b8629 Merge upstream main into the PR branch 2026-11-30 18:31:59 +00:00
52ed0b51a8 awc_opus: pass skip_existing into the parallel workers
merzleckeier measured it on CachyOS: --skip-existing --jobs 1 left 0 of 3
existing outputs alone, --skip-existing --jobs 2 rewrote 3 of 3. The submit call
passed export_bank four arguments where the serial call passed five, so the
flag never crossed into the pool. The unit test above it calls export_bank
directly - the function, not the CLI - which is why the plumbing was not
covered; the new test runs the tool as a subprocess for --jobs 1 and 2, freezes
an output, and carries its own control (the same command without the flag must
rewrite the frozen file).
2026-11-30 18:58:49 +01:00
6dbbe6df5a Merge pull request #2759 from OreoFR/test/launcher-serve-fetch-cleanup
tests/test_launcher_serve: stop the file server before removing its folders (WinError 32 flake)
2026-11-30 17:50:29 +01:00
bd466f8839 Merge pull request #2730 from OreoFR/carry/pr-2362
reprend #2362: rdna2spirv: forward DPP src0 neg/abs to op readers instead of eager 32-bit modify (SHADER-DPP-F16-AND-SIGN-MODS)
2026-11-30 17:24:41 +01:00
1c78b8219e Merge pull request #2728 from OreoFR/carry/pr-65
reprend #65: rdna2spirv: translate FLAT loads and stores as global accesses
2026-11-30 17:24:22 +01:00
35e75b7a9d Merge pull request #2731 from OreoFR/carry/pr-2174
reprend #2174: rdna2spirv: seed the POPS collision word so the wait loop ends (SHADER-POPS-COLLISION-SEED)
2026-11-30 17:24:02 +01:00
20e9dea0fe tests/test_launcher_serve: join the file server's handler threads on close, strict cleanup
merzleckeier forced the schedule on Windows (#2759): with ThreadingHTTPServer's
daemon handler threads, server_close() returned while the handler still held
art.jpg, so ignore_cleanup_errors only hid it and left the file behind. With
daemon_threads = False, server_close() joins the handlers, which close their
files first; the folder's removal is strict again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:16:53 +01:00
2b85ec1249 Merge commit 'a4ed2638981ff3e7b9590e618dddc382115952aa' into fix/1080-1440p-motion-blur-switch 2026-11-30 17:04:36 +01:00
f27cd4ae22 tests/test_launcher_serve: stop the file server before its folders go, and don't fail on a file still open
FetchTests made their temporary folders with 'with', so they were removed when
the test body ended, before the cleanups stopped the test's HTTP server; on
Windows the handler thread could still hold art.jpg open and the removal failed
with PermissionError [WinError 32] (seen on #2724, #2734 and #2754). The folders
are now made with enterContext before the server, so the server stops first, and
with ignore_cleanup_errors=True.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:04:00 +01:00
a21a62af1b Merge pull request #2719 from OreoFR/carry/pr-1406
reprend #1406: Honor package load_tests hooks in the parallel semantic runner
2026-11-30 17:03:15 +01:00
a4ed263898 Merge pull request #2746 from OreoFR/reprise-1837
tools/game_run_summary: guard stdout encoding, BOM ints, OSError and RecursionError (reprend #1837)
2026-11-30 17:02:59 +01:00
e324ad55ed Merge pull request #2720 from OreoFR/carry/pr-2093
reprend #2093: spirv_opt: scalar-replace surviving static Function arrays (SHADER-SPIRV-OPT-SROA)
2026-11-30 17:02:39 +01:00
c663c2a85e Merge pull request #2724 from OreoFR/carry/pr-282
reprend #282: fix(rdna2spirv): order image_sample, image_gather4, image_bvh and ignore ds_nop in --wave64-emulate
2026-11-30 17:02:20 +01:00
ca5b392cec Merge pull request #2723 from OreoFR/carry/pr-1994
reprend #1994: rdna2spirv: extract per-lane bits for non-mask special sources in s_mov_b32 exec_hi (SHADER-EXEC-HI-SPECIAL-SRC)
2026-11-30 17:02:03 +01:00
ca191f633c Merge pull request #2626 from merzleckeier/codex/d3d12-motion-blur-f1
d3d12: preserve -MotionBlur across F1 restart
2026-11-30 16:59:10 +01:00
be76908059 Merge pull request #2722 from OreoFR/carry/pr-1906
reprend #1906: wave64_emulate_opt: model s_bitset0/1_b32/b64 as read-modify-write and SCC-less (SHADER-W64-EMU-BITSET-RMW)
2026-11-30 16:12:58 +01:00
5399c667e2 Merge pull request #2721 from OreoFR/carry/pr-1907
reprend #1907: wave64_halves: model image_atomic_* as atomic memory sinks (SHADER-W64-HALVES-IMAGE-ATOMIC)
2026-11-30 16:11:53 +01:00
f5f80759fe d3d12: bind MotionBlur in the dynamic resolution preset 2026-11-30 16:08:17 +01:00
dbd6ccc2ba tests: end the file with one newline, not two
No content change.
2026-11-30 15:47:21 +01:00
e5c8492806 tests: end the file with one newline, not two
No content change.
2026-11-30 15:47:16 +01:00
bed9ed0c16 tests: end the file with one newline, not two
No content change.
2026-11-30 15:47:12 +01:00
a70a976cd8 Merge remote-tracking branch 'origin/main' into reprise-1837 2026-11-30 15:38:14 +01:00
aa0687837f Merge remote-tracking branch 'upstream/main' into fix/decode-ds-llvm-parity 2026-11-30 14:04:40 +00:00
b3b064bb79 tests: keep swizzle_search coverage when the user site is isolated
Applied from merzleckeier's follow-up (f9456e020), unchanged: the two render()
calls use the parent's numpy and Pillow, and the three CLI validation checks
finish before the child needs numpy, so all five should run rather than skip.
The two PNG preview subprocesses need Pillow in the child, which the isolated
probe now checks.

Written with an AI assistant.
2026-11-30 14:55:47 +01:00
1eee5a1aaa tests: a sibling that imports a numeric tool is not a startup failure
test_each_sibling_importing_tool_starts skipped a NUMERIC list when numpy was
missing, but it asked find_spec in this process while the tools run with -I, so
the skip never fired here; and a list of names cannot cover calibrated_texture
and tex_export, which are not numeric themselves and import one that is.

The probe now matches how the tools run, and a child that fails with
"No module named 'numpy'" is skipped rather than failing the startup check.

Measured on main b8bd37111, Windows 11, Python 3.13: 2 failed, 2 passed,
218 subtests before; 2 passed, 214 subtests after (the four are the two
numpy-dependent subtests, skipped). With numpy visible to -I nothing changes.

Written with an AI assistant.
2026-11-30 14:55:47 +01:00