Commit Graph

1236 Commits

Author SHA1 Message Date
fc0ce37ac4 scripts: red_green.py reports a cargo run stopped before any test ran as timed out building, not caught (review)
A mutated cargo run that times out before its first Running line was still a build: it says nothing about the tests, so it is no longer counted as caught by timeout. A stub cargo that hangs in its build or in a test binary now covers the cargo timeout path, which no test reached before.
2026-12-02 05:19:44 +01:00
4a0aa701d0 scripts: red_green.py lists the hunks --mutate-max leaves out (review)
With more code hunks than --mutate-max, the report read as if every hunk was tried. The hunks left out are now in --json (mutations_skipped, file and line) and in the text (not tried, past --mutate-max).
2026-12-02 05:19:44 +01:00
0d2dea6c70 scripts: red_green.py tells a hunk of test code only with one rule, for the red side and for the mutations (review)
code_hunks looked only at the lines a hunk adds, so a hunk that deletes an obsolete test inside a #[cfg(test)] module was mutated and read as not caught, while the red side took it as a test hunk. Both now use test_hunk_flags: every removed or added line is test code, blank or a comment, and one at least is test code.
2026-12-02 05:19:44 +01:00
29712017c4 scripts: red_green.py starts each mutation from a commit of the green merge, reset and cleaned (review)
A put-back that applies did not prove the tree green again: a test that wrote into a tracked file changed the result of the next hunk. The green merge is now committed with the tool's identity before its tests run, and each mutation resets the tree to it and cleans it before undoing its hunk. A hunk can no longer fail to go back, so mutations_stopped and its test are gone; a test that dirties the tree now has its own.
2026-12-02 05:19:44 +01:00
312bf7c892 scripts: red_green.py stops what a mutated run leaves behind, so an orphan holding its output does not hold the run (review)
taskkill /T on a command that has already ended finds no tree: a child it left behind kept the output pipe open, the run waited for the timeout and a real caught read caught by timeout. A mutated run now writes its output to a temporary file and, on Windows, runs in a job object (kill on close) that its children join; once the command ends or times out, the job (the process group elsewhere) is stopped.
2026-12-02 05:19:44 +01:00
a7a22ff874 scripts: red_green.py removes only the work tree's own __pycache__ folders, never through a link or junction (review)
Path.rglob follows directory junctions on Windows, so a junction in the tree to an outside folder had that folder's __pycache__ deleted, and a link itself named __pycache__ made shutil.rmtree raise. The walk now skips symbolic links and every reparse point (junctions included).
2026-12-02 05:19:44 +01:00
df480832d7 scripts: red_green.py keeps the test files a tree has in one place, side() (review) 2026-12-02 05:19:44 +01:00
89274bac6e scripts: red_green.py --mutate says when it stopped, why nothing was undone, and which added files it does not mutate (review)
A hunk that cannot be put back no longer drops the whole mutations section: the report and --json (mutations_stopped) name the hunk, the reason and how many hunks were not tried. With --mutate, mutations is always a list and mutations_not_run says why none was undone: nothing to undo (a test-only pull request), or no test went red then green. Files the pull request adds stay unmutated, and the report and --json (added_not_mutated) now list them. Verdicts and exit codes are unchanged.
2026-12-02 05:19:44 +01:00
745808fc3b scripts: red_green.py --mutate-timeout stops a mutated run that hangs and reports it as caught by timeout (review)
Each command of a mutated run (cargo test, one Python test file) is stopped after --mutate-timeout seconds (600) together with the processes it started (taskkill /T on Windows, the process group elsewhere): a test binary or a process a test starts would otherwise keep the output pipe open. The hunk is then 'caught by timeout', apart from 'caught'. The red and green sides have no timeout, as before.
2026-12-02 05:19:44 +01:00
de6db4b733 scripts: red_green.py removes the work tree's __pycache__ before each Python run, so no test runs stale bytecode (review)
-B only stops writing bytecode. An ignored .pyc left in the work tree (git clean keeps it) ran instead of the reverted source: red passed and an undone hunk was not caught. -X pycache_prefix would cover the unittest process only, not the processes its tests start; removing the folders covers both.
2026-12-02 05:19:44 +01:00
dc63e371ce scripts: red_green.py --mutate checks that the tests catch the change itself (TEST-RED-GREEN-MUTATION)
Verifiers remove a line of the fix by hand on nearly every test pull request to see the new test fail.
--mutate does it for each hunk of the pull request's code outside its tests (Rust and Python files it
changes; hunks taken without context, so a test changed next to the code stays out): after the green
side, it undoes that hunk alone, runs the tests again and reports it as caught (a test that went red
then green fails), not caught, does not build or does not apply, up to --mutate-max hunks (10); the
hunk is put back after each run. Python tests now run with -B: an undone change of the same size within
the same second would otherwise run the stale bytecode.
2026-12-02 05:19:44 +01:00
4b67b07045 Merge pull request #2931 from Mykolas009/d3d12/f1-dlss-rebuild
d3d12: the DLSS build is asked for once NVIDIA's SDK is here, whatever the switches (D3D12-F1-DLSS-REBUILD)
2026-12-02 00:48:23 +00:00
5b03c688bf Merge pull request #2966 from aznohonza/scripts/entry-point-help
scripts: --help answers in the Python and shell entry points
2026-12-02 00:47:12 +00:00
5d06e4793e Merge pull request #2967 from aznohonza/tools/cgroup-memory-peak
game_run_summary: record the run cgroup's memory peak
2026-12-02 00:07:43 +00:00
1abef08d09 Merge pull request #2902 from budanga/fix/boot-ps1-python-alias
boot.ps1: take a Python that starts and is 3.12+, not the Microsoft Store alias (BOOT-PS1-PYTHON-ALIAS)
2026-12-01 22:15:01 +00:00
9fc7de03e3 game-gate: the DLSS preflight follows the switch PowerShell binds (D3D12-F1-DLSS-REBUILD)
The preflight added in 218b0328b read -NoDlss out of -PlayArgs with a pattern over
the text. Two reviews of the pull request showed where that goes wrong:

- `-NoDlss: $true`, a space after the colon, binds true, and the gate refused the
  run and asked for a DLSS rebuild (andrew-ai, PowerShell 7.6.9);
- `-Adapter 'Fixture -NoDlss Adapter'` binds no switch, and the gate let the run
  go on into a build inside the run (merzleckeier, PowerShell 7.4.21).

The gate now asks PowerShell itself: Test-NoDlssBound takes the param block of
scripts\play-d3d12.ps1 and lets it bind the arguments the launch line gives the
script (-Game, -Data, -More, then -PlayArgs); nothing of the play script runs.
The first thing the probe writes is the answer, so text behind a `;` in
-PlayArgs cannot stand in for it. Arguments PowerShell cannot bind (an ambiguous
-No, a switch that does not exist, a value outside a ValidateSet) count as
-NoDlss not said, as the start itself fails on them, and the refusal then says
that they did not bind and with which error. The probe is reached only when the
build's note, the SDK and cargo already say the play script would build.

tests/test_game_gate.py takes the function out of the script and puts 19 lines of
-PlayArgs to PowerShell 7 against the real play script's parameters: bare,
shortened, :$true, : $true, :$false, : $false, alone and among other switches,
the quoted adapter name alone, with -NoDlss:$false and with a real -NoDlss, an
argument that does not bind, and a `; $true` behind the arguments (skipped where
there is no pwsh). A second test holds that no pattern is matched against
-PlayArgs any more.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-02 00:05:03 +02:00
1228aad135 scripts: the help tests cover -h too, and play-linux names LEONIDA_GAME_DIR
Dropping -h from run_wine_session.sh or check_no_game_data.py now fails the
test that covers it, and play-linux.sh's usage lists LEONIDA_GAME_DIR with
the other path variables (it already honours it).

AI-assisted.
2026-12-01 22:45:38 +01:00
218b0328b8 game-gate: no run with a build the play script would make again for DLSS (D3D12-F1-DLSS-REBUILD)
The gate refuses to run without a build, because the play script would make
it inside the run. Since the change before this one, play-nvidia.ps1 also
makes a build noted as made without DLSS again once NVIDIA's SDK is there,
whatever the start's switches ask for: on such a checkout that build too
would be made inside the run, after the gate wrote down the exe's hash and
what it was built with. The gate now refuses that run as well and names the
build script. Not with -NoDlss in -PlayArgs (shortened or with :$true too)
and not without cargo: the play script makes no build then.

That commit's message calls this guard a follow-up, for want of PowerShell 7
on the PC it was written on; it has been installed since, and this is it.

Checked with PowerShell 7.7.0: the guard's own lines against a synthetic
folder, eleven cases; and the whole script twice. With a build noted as made
without DLSS and the SDK there it refuses before anything starts (exit 1, no
run folder). With a build noted as made with DLSS it goes on as before:
run.json carries built_with, and the run ends at once with ERROR not_started,
there being no game in the folder.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 22:43:34 +02:00
298313282a test_boot_ps1_python: test the 3.12 floor and that a hanging candidate leaves no process (BOOT-PS1-PYTHON-ALIAS)
The older-Python stand-in only exited 1, so changing (3, 12) in Test-Python left every test green. A stand-in now
runs Test-Python's own check with sys.version_info set: 3.11.9 is passed over for py -3 and 3.12.0 is taken. The
hanging stand-in sleeps in a Python child with a unique tag on its command line, and the test asserts that no
process holding the tag is left once Resolve-Python returns.

Test-Python's comment now gives the requirement it follows: the repository needs 3.12+ (README.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:46:47 -03: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
cc846ba5ca Merge pull request #1302 from delysidemanYT1/gpu-runner-temp-error
GPU-RUNNER-TEMP-ERROR: report temporary directory creation failures
2026-12-01 16:14:58 +01:00
f0c4fe0b43 Merge pull request #1253 from NinsonD/feat/public-github-metadata-export
Feat/public GitHub metadata export
2026-12-01 16:14:46 +01:00
20fb2cc182 Merge pull request #1140 from PierreEbele/linux-deps-installer
scripts: install the Linux prerequisites in one command (BUILD-LINUX-DEPS-INSTALLER)
2026-12-01 16:14:22 +01:00
cf15c2c6ed d3d12: a typed switch wins over the F1 menu, not a value that changed (D3D12-MENU-LAST-CHOICE-WINS)
Review of the first version: a value that differs from the last start's command line was taken for the user's new
choice. That lost an explicit flag on the first start after an upgrade, never let the same flag typed again win, and
dropped a menu value the command line never mentioned when leonida-launch.txt lacked the key. The menu file was also
rewritten before the history, so a failed history write had already lost a saved choice.

Now the rule follows what the user typed:
- A switch typed for this start wins over the menu's saved value of each setting it makes. The menu file drops that
  value, so F1 shows the command line's. scripts\play-d3d12.ps1 passes the switches typed there as -Typed, so its
  Series X default and -Lowest 1080 leave the menu's choice standing. A start by hand counts its own switches, and
  -More wins like a typed switch.
- Every other setting keeps the menu's value.
- The menu's SAVE AND RESTART adds -MenuRestart to the switches it replays (LEONIDA_MENU_ARGS), so there the menu's
  values, saved after those switches, win.

leonida-launch.txt is gone. The menu file is written to a temporary file and moved over the old one, and only when a
value leaves it. If that fails, the start runs with the command line's values and the file stays whole.

Tests: 10 cases, among them the same switch typed again, an untyped default, a setting no switch makes, the restart,
a start by hand, -More and a menu file that cannot be written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:20:54 -03:00
b3910e5e3d Merge pull request #2814 from TheGeogeo/test-red-green-compiler-crash
scripts: red_green.py tells a crashed compiler from a build error (TEST-RED-GREEN-COMPILER-CRASH)
2026-12-01 15:06:18 +01:00
8a72e40d87 Merge remote-tracking branch 'origin/main' into tools/cgroup-memory-peak 2026-12-01 13:22:50 +01:00
c60ce461af Merge pull request #2334 from kirigayakazima/fix/merge-check-safety
merge_check: guard ref option injection, bounds, and git timeouts
2026-12-01 12:57:50 +01:00
abf475ef65 Merge remote-tracking branch 'origin/main' into tools/cgroup-memory-peak
# Conflicts:
#	tests/test_run_game_wine.py
2026-12-01 12:55:58 +01:00
3fbc120df4 Merge pull request #1397 from whoalin1/mask-regs-data-read
rdna2spirv: a VALU data read of a lane-mask operand yields the wave's mask word
2026-12-01 12:53:35 +01:00
a726736ec2 Merge pull request #1774 from Tauwni/fix/explicit-lod-bias-moltenvk
rdna2spirv: --explicit-lod-bias applies the S# LOD bias where MoltenVK drops the sampler's; ps_ssharp passes on Macs (SHADER-EXPLICIT-LOD-BIAS-MVK)
2026-12-01 12:45:24 +01:00
4913ef152e Merge pull request #2436 from kawaii-shakal/wine-run-shader-cache
run_game_wine.sh: keep the drivers' shader cache from run to run (WINE-RUN-SHADER-CACHE)
2026-12-01 12:30:40 +01:00
f613e6d8ea Merge remote-tracking branch 'upstream/main' into HEAD
# Conflicts:
#	scripts/merge_check.py
2026-12-01 19:13:49 +08:00
19d62a98d4 Linux: enable scoped copy and descriptor tracking defaults (#2700)
* Linux: enable scoped copy and descriptor defaults

* Test Linux launcher optimization defaults and opt-outs
2026-12-01 11:52:20 +01:00
c6c8f5f5a3 scripts: build llvm-mc 23.1.5 by default, so the pipeline library translates (#1923)
* scripts, tools: build llvm-mc 23.1.5 by default, so the pipeline library translates

LLVM 21.1.8's gfx1013 decoder cannot decode 840 of the 2,684 compute
programs in the pipeline library of 1.0.2.1: their listings carry 79,490
undecodable words and 8,310 exp invalid_target_N lines, the translator
refuses all of them as "fall-through into undecodable words", and the
shaders stage keeps 1,844 of 2,684. LLVM 21 does translate all 26,503
shaders of shaders.rpf; the library is what it loses.

The same bytes under llvm-mc 23.1.5 have no rejected word in those 840,
and 839 of them translate and pass spirv-val (the last wants s_sethalt,
which the translator does not implement, under either version). The 1,844
that already translated were re-disassembled too: 1,674 listings change
and all 1,674 still translate, the other 170 are byte-identical, so the
stage goes from 1,844/2,684 to 2,683/2,684.

The build helper now builds 23.1.5 by default. The docs that name the
minimum version (README, docs/design.md, docs/testing.md, docs/linux.md)
and the three user-facing messages that still said 21+ (make_game.py's
preflight, shader_disasm.py's probe error, mc_command.py's install hint)
now say 23+, with the tests that assert those texts updated.

AI-assisted (DeepSeek Harness).
Written with an AI assistant.

* docs: LLVM 23 is what the shaders stage needs, and a test pins the script's default
2026-12-01 11:48:54 +01:00
6da607c096 scripts: --help on the Python and shell entry points
check_no_game_data.py read `--help` as a path and answered "cannot read --help", exit 2, in the tool every
contributor is told to run; it now prints the usage text it already carries and exits 0. play-linux.sh and
run_wine_session.sh print their usage before any environment check, where they used to answer with an error
(and play-linux.sh's no-argument case still prints the same usage, on stderr, exit 2).

run_game_wine.sh's one-line Usage line names the required --shaders, which its Inputs section already listed.

A test per script fails on main's copies and passes here.
2026-12-01 10:29:39 +01:00
2095f63086 Fix exporter stdout encoding on Windows 2026-12-01 12:30:21 +04:00
d9c470cd30 game_run_summary: record the run cgroup's memory peak 2026-12-01 08:41:52 +01:00
f442c3dfba scripts: red_green.py tells a crashed compiler from a build error (TEST-RED-GREEN-COMPILER-CRASH)
A verification's only trial said "red does not build" while rustc had crashed (0xC0000005). A side whose
cargo output shows rustc or a build script ending with a Windows crash status, an internal compiler
error or a failed allocation now builds again once, and the report says so; a second crash gives the
verdict `compiler crashed` (exit 1), not `red does not build`. A test binary that crashes stays a test
result.
2026-12-01 01:49:41 +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
cd9fe51a9c Merge pull request #2752 from alpfilho/d3d12/borderless-fullscreen
d3d12: Alt+Enter switches to borderless fullscreen instead of freezing the picture (D3D12-BORDERLESS-FULLSCREEN)
2026-11-30 18:53:54 -05: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
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
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
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
22d58b8629 Merge upstream main into the PR branch 2026-11-30 18:31:59 +00:00
d985409b61 d3d12: Alt+Enter switches to borderless fullscreen instead of freezing the picture (D3D12-BORDERLESS-FULLSCREEN)
Alt+Enter went to DXGI's own exclusive fullscreen, for which nothing here makes the buffers
again: the picture froze and the screen stayed black. The presenter now turns DXGI's Alt+Enter
off (MakeWindowAssociation with DXGI_MWA_NO_ALT_ENTER, on the swap chain's own factory), and
the title window's procedure in lifecycle.rs handles the key itself:

- Alt+Enter takes the title's window without its frame over the whole of its monitor, and the
  next one gives back its frame and its place. A held key's repeats do nothing, and the
  character it makes (a beep) does not reach the title.
- Going back gives back only the frame and edge styles, so a window made borderless before it
  was first shown stays shown.
- LEONIDA_FULLSCREEN=1 (the launchers' -Fullscreen, or FULLSCREEN (NO BORDER) in the F1 menu)
  makes the window borderless from the start.

The swap chain is not made again: its picture is scaled to the window as before
(LEONIDA_PRESENT_SCALE). Two tests send the keys to a window of their own.

The idea is VIctory's (trustno1-coder/VIctory-NVIDIA has a borderless fullscreen); the code is
written for leonida-hle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 13:38:40 -03:00
08e42a5160 Merge pull request #2691 from fiestorra/fix/paravirtual-exp2-skip
runner: skip the exact exp2 case on Apple's Paravirtual device (re-opened #2641, closed by an accidental push)
2026-11-30 17:28:44 +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