regress.py runs the repository's profile, not a provisional one left in the build folder

regress.py took any <id>_build/profile/<id>/game.tsv as a derived profile
and ran it instead of dm/games/<id>. The NSP script leaves a provisional
profile there from a game's first packing, before its profile is added, so
38 of the 57 games on the game drive were tested with their guessed
profiles. OCTOPATH TRAVELER 0's had no tex_dyn_slots (three particle shaders
refused, with red lines), no fps_target and no depth_mode.

A build's profile now runs only when it is derived (the NSP script's
<id>.derived.key beside it) or the game has no profile in dm/games. The games
line marks such a game with "the build profile". On the game drive that
leaves Mario Kart 8 Deluxe (derived) and Atelier Ryza (no profile yet).
This commit is contained in:
seedds committed 2026-10-30 21:26:27 +08:00
1 parent 602ed11575
commit e513bfeb24
3 files changed
+18 -4

No files matched your search

+12 -1
View File
@@ -246,7 +246,7 @@ class Regress(unittest.TestCase):
self.assertEqual(regress.worst('PASS', 'CHANGED', 'REGRESSION'), 'REGRESSION'); self.assertEqual(regress.worst('NEW-FAIL', 'ERROR'), 'ERROR')
def test_selection_keeps_games_without_routes(self):
games = [NS(id='a', name='routed', kind='nvn', route=lambda: {'save': 'new'}), NS(id='b', name='unrouted', kind='nvn', route=lambda: None)]
games = [NS(id='a', name='routed', kind='nvn', derived=False, route=lambda: {'save': 'new'}), NS(id='b', name='unrouted', kind='nvn', derived=False, route=lambda: None)]
with patch.object(regress, 'find_games', return_value=games), patch.object(regress, 'say'):
self.assertEqual(regress.select(NS(games=None), smoke=True), games)
@@ -312,6 +312,17 @@ class Regress(unittest.TestCase):
with patch.object(regress, 'sh', return_value=NS(stdout=processes)), patch.object(regress.os, 'getpid', return_value=200):
self.assertEqual(regress.heavy_jobs(), ['103 metal /another/build.metal', '104 make dmhost'])
def test_build_profile_runs_only_when_derived_or_unported(self):
# A provisional profile the NSP script left from before the game's profile was added must not shadow dm/games' (it lacked OCTOPATH TRAVELER 0's tex_dyn_slots and fps_target)
with tempfile.TemporaryDirectory() as td, patch.object(regress, 'REPO', Path(td) / 'repo'):
root, gid = Path(td), '0123456789ABCDEF'
build = root / f'{gid}_build'; (build / 'profile' / gid).mkdir(parents=True); (build / 'profile' / gid / 'game.tsv').write_text('# Provisional game profile\n')
self.assertTrue(regress.Game(root, build).derived) # no profile in dm/games: the provisional one
(root / 'repo/dm/games' / gid).mkdir(parents=True); (root / 'repo/dm/games' / gid / 'game.tsv').write_text('title_id\t' + gid + '\n')
self.assertFalse(regress.Game(root, build).derived) # a profile in dm/games: it runs, not the leftover guesses
(build / 'profile' / f'{gid}.derived.key').write_text('key\n')
self.assertTrue(regress.Game(root, build).derived) # derived from it for another version
def test_chain_key_tracks_shader_package_and_split_pairs(self):
with tempfile.TemporaryDirectory() as td:
root = Path(td); pkg = root / 'shader/pkg'; pkg.mkdir(parents=True)
+1 -1
View File
@@ -289,7 +289,7 @@ python3 scripts/regress.py replay # replay those captures against t
`--games <id>,…` selects games, `--baseline` / `--candidate` take any revision (`worktree` is this checkout), `--lock` (or `DM_MEASURE_LOCK`) is the measuring lock `bench.py --lock` shares, held only while a game runs, and `REGRESS_SKIP=<id>,…` leaves out a game someone else is working on. Source trees and public reports go under `--root` (`REGRESS_ROOT`), the games' NSP folders are found under `--games-dir` (`REGRESS_GAMES`); both have no default, since they depend on the machine, and go before the command (`regress.py --root <drive>/harness --games-dir <drive>/nsp check …`). All commands except `impact` require both paths; `impact` reads only git and committed manifests, prints its report without either path, and saves it with `--out` or under an existing configured root. Each revision is checked out once into `trees/`, and its chain, host and rewriter come from there. Game-derived files (shader libraries, rewritten modules, profile copies, saves, screenshots and baselines) stay in the game's NSP folder at `<id>-work/regress/`. Shader tools write generated tables only into those profile copies. The games are the NSP folders under `--games-dir` (`REGRESS_GAMES`). The exit status is 0 without a regression, 1 with one, and 2 when the harness could not check a game.
The default selection keeps every local build for the chain checks; games with a `smoke.tsv` also run its route. A game without a route does not build a host or run. `check --no-smoke` and `baseline --no-smoke` perform only the chain and interface checks. The chain cache includes the shader package's contents and the split's fallback `pso_pairs.tsv`; Vulkan builds include captured SPIR-V from the packed version's `vk_capture` folder. Interface checks run again with each revision's archive planner and profile even when the libraries are reused. Stored smoke baselines are reused only while the route, save bytes, build artifacts, compilers, machine and run settings match; older records are recorded again. Each candidate run must supply its scheduled screenshots, and a prebuild that crashes or times out fails the run. With repeated runs, every candidate screenshot is compared with its closest baseline screenshot.
The default selection keeps every local build for the chain checks; games with a `smoke.tsv` also run its route. A game without a route does not build a host or run. Each revision runs its own `dm/games/<id>` profile; the build's `<id>_build/profile/<id>` runs instead only when it is derived (`<id>.derived.key` beside it) or the game has no profile in `dm/games` (the games line says `the build profile`), so a provisional profile left from before the game's profile was added is not tested in its place. `check --no-smoke` and `baseline --no-smoke` perform only the chain and interface checks. The chain cache includes the shader package's contents and the split's fallback `pso_pairs.tsv`; Vulkan builds include captured SPIR-V from the packed version's `vk_capture` folder. Interface checks run again with each revision's archive planner and profile even when the libraries are reused. Stored smoke baselines are reused only while the route, save bytes, build artifacts, compilers, machine and run settings match; older records are recorded again. Each candidate run must supply its scheduled screenshots, and a prebuild that crashes or times out fails the run. With repeated runs, every candidate screenshot is compared with its closest baseline screenshot.
Per game it checks:
- **Chain** (no GPU): the shaders built by each revision's `dmsh_build.py` (a Vulkan game: `vk_shaders.py`), shader by shader: built or failed (newly failing by the rule of `shader_regressions.py`, which it imports; a new shader that fails is listed apart), and the SHA-256 of the MSL, of the reflection without its chain fields and of the variant libraries. A build is kept per chain version, profile inputs and compilers (`<NSP folder>/<id>-work/regress/chain/`), so a revision that did not change the chain reuses it, and the build takes the game's own shader cache (`DMSH_CAS`), so unchanged MSL is not compiled again. A changed chain still translates every shader: Breath of the Wild's 19,592 took 14 minutes on an M2 Max.
+5 -2
View File
@@ -247,7 +247,10 @@ class Game:
self.patched = bench.newest(build.glob('patched_v*'))
self.ver = self.patched.name.removeprefix('patched_') if self.patched else None
self.kind = 'nvn' if (build / 'shader/pkg').is_dir() else 'vk' if (build / 'shader/vk').is_dir() else 'gl' if (build / 'shader/gl').is_dir() else None
self.derived = (build / 'profile' / self.id / 'game.tsv').is_file()
# The build's own profile runs instead of dm/games' only when it is derived (the NSP script's <id>.derived.key beside it: a version the game's profile was not brought up
# on) or the game has no profile here (a provisional one). A provisional profile the NSP script left from before the game's profile was added would test its guesses
own = build / 'profile' / self.id
self.derived = (own / 'game.tsv').is_file() and ((build / 'profile' / f'{self.id}.derived.key').is_file() or not (REPO / 'dm/games' / self.id / 'game.tsv').is_file())
def romfs(self):
r = bench.rfs.source(self.build / 'extract' / self.ver)
@@ -1443,7 +1446,7 @@ def cmd_impact(a):
def select(a, smoke):
games = find_games(a.games.split(',') if a.games else None)
if not games: raise HarnessError(f'no game with a Mac build under {GAMES}')
say('games: ' + ', '.join(f"{g.id} ({g.name}, {g.kind}{', route' if g.route() else ''})" for g in games))
say('games: ' + ', '.join(f"{g.id} ({g.name}, {g.kind}{', route' if g.route() else ''}{', the build profile' if g.derived else ''})" for g in games))
return games