Files
UnixNight 472500bf4e test(01-07): integrate counted fidelity regressions and exact local results
Run existing fidelity Python, Node and observer checks with positive-count guards and explicit TAP output. Record the completed 782.05-second local suite and preserve human acceptance at 0/120.
2026-11-13 16:44:59 -05:00

158 lines
12 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
source "$(dirname "$0")/env.sh"
suite_started=$SECONDS
mkdir -p artifacts/fidelity
python3 - <<'PY'
import sys
import unittest
suite = unittest.defaultTestLoader.discover('tests', pattern='test_*.py')
def cases(node):
for item in node:
if isinstance(item, unittest.TestSuite):
yield from cases(item)
else:
yield item
counts = {}
for case in cases(suite):
module = case.id().split('.')[0]
if module.startswith('test_fidelity_'):
counts[module] = counts.get(module, 0) + 1
required = ('sessions', 'scenarios', 'review', 'ledger', 'observation',
'checkpoint', 'capture', 'acceptance')
assert all(counts.get('test_fidelity_' + name, 0) > 0 for name in required), counts
print('Fidelity Python checks:', sum(counts.values()), counts, flush=True)
sys.exit(not unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful())
PY
node --test --test-reporter=tap tests/fidelity-viewer.test.mjs | tee artifacts/fidelity/consolidated-viewer.log
python3 - <<'PY'
import re
from pathlib import Path
text = Path('artifacts/fidelity/consolidated-viewer.log').read_text()
assert re.search(r'^# tests [1-9][0-9]*$', text, re.M), 'zero/missing viewer checks'
PY
dotnet run --project tests/GamePort.FidelityObservationTests | tee artifacts/fidelity/consolidated-observer.log
python3 - <<'PY'
import re
from pathlib import Path
text = Path('artifacts/fidelity/consolidated-observer.log').read_text()
assert re.search(r'Fidelity observation checks: [1-9][0-9]* passed', text), 'zero/missing observer checks'
PY
python3 tools/extractors/prepare.py --all-scenes --audio sounds musicsecretlab
dotnet run --project tests/GamePort.DataTests -- ../Original
dotnet run --project tests/GamePort.CollisionTests -- ../Original
dotnet run --project tests/GamePort.MovementTests -- ../Original
dotnet run --project tests/GamePort.JimmyGroundTests
dotnet run --project tests/GamePort.JimmyAirTests
dotnet run --project tests/GamePort.JimmyOrientationTests
dotnet run --project tests/GamePort.JimmyRenderTests
dotnet run --project tests/GamePort.JimmyJumpTests
dotnet run --project tests/GamePort.DirectorTests -- ../Original
dotnet run --project tests/GamePort.PatrolTests -- ../Original
dotnet run --project tests/GamePort.SupportTests -- ../Original
dotnet run --project tests/GamePort.SphereResponseTests
dotnet run --project tests/GamePort.StaticCollisionTests
dotnet run --project tests/GamePort.BodyPhysicsTests
dotnet run --project tests/GamePort.BodyOwnershipTests
dotnet run --project tests/GamePort.PairLifecycleTests
dotnet run --project tests/GamePort.DynamicContextTests
dotnet run --project tests/GamePort.DynamicReclipTests
dotnet run --project tests/GamePort.ActorContactTests
dotnet run --project tests/GamePort.GadgetTests
dotnet run --project tests/GamePort.InvisibleTests
dotnet run --project tests/GamePort.BubbleMotionTests
dotnet run --project tests/GamePort.BubbleVisualTests
dotnet run --project tests/GamePort.BubbleTests
dotnet run --project tests/GamePort.BaseballTests
dotnet run --project tests/GamePort.BaseballVisualTests
dotnet run --project tests/GamePort.RocketFlightTests
dotnet run --project tests/GamePort.RocketshipTests
dotnet run --project tests/GamePort.GrapplerLiveTests
dotnet run --project tests/GamePort.ScooterTests
dotnet run --project tests/GamePort.ScooterAudioTests
dotnet run --project tests/GamePort.GrapplerTests
dotnet run --project tests/GamePort.HeadingTests
dotnet run --project tests/GamePort.BlendTests
dotnet run --project tests/GamePort.CameraRayTests
dotnet run --project tests/GamePort.InteractionTests -- ../Original
dotnet run --project tests/GamePort.CheckpointTests -- ../Original
dotnet run --project tests/GamePort.DebugMenuTests -- ../Original
dotnet run --project tests/GamePort.DebugOverlayTests
dotnet run --project tests/GamePort.UiViewportTests
dotnet run --project tests/GamePort.DebugDiagnosticsTests
SDL_AUDIODRIVER=dummy dotnet run --project tests/GamePort.AudioPauseTests
dotnet run --project tests/GamePort.LabRouteTests -- ../Original
dotnet run --project tests/GamePort.UndergroundRouteTests -- ../Original
dotnet run --project tests/GamePort.DynamicCollisionTests -- ../Original
dotnet run --project tests/GamePort.JetpackTests
dotnet run --project tests/GamePort.PlayerVisualTests -- ../Original
dotnet run --project tests/GamePort.ObjectiveTests -- ../Original
dotnet run --project tests/GamePort.ProjectionTests -- ../Original
python3 tests/GamePort.HudTests/test_ui.py
dotnet run --project tests/GamePort.HudTests -- artifacts/extracted/ui/ui.json
dotnet build GamePort.csproj
dotnet run --no-build -- --verify-assets --assets ../Original
python3 tools/extractors/omt.py ../Original/omt/level1b.omt --scene --output artifacts/extracted/level1b
dotnet run --no-build -- --headless --assets ../Original --scene artifacts/extracted/level1b/scene.json --level gam/level1b.gam --original-camera --screenshot artifacts/test-level1b.ppm
dotnet run --no-build -- --inspect --headless --with-player --time 0.05 --screenshot artifacts/test-player.ppm
dotnet run --no-build -- --headless --smoke-walk --screenshot artifacts/test-walk.ppm
dotnet run --no-build -- --headless --story --story-time 12 --screenshot artifacts/test-story.ppm
dotnet run --no-build -- --headless --story --smoke-practice-prompt --screenshot artifacts/test-practice.ppm
dotnet run --no-build -- --headless --story --smoke-practice-transition
dotnet run --no-build -- --headless --smoke-practice-return --screenshot artifacts/test-practice-return.ppm
dotnet run --no-build -- --headless --debug-menu --screenshot artifacts/test-debug-menu.ppm
dotnet run --no-build -- --headless --skip-intro --gadget-menu --width 1920 --height 1080 --screenshot artifacts/test-gadget-menu.ppm
dotnet run --no-build -- --headless --debug-page player --noclip --width 1920 --height 1080 --screenshot artifacts/test-debug-player.ppm
dotnet run --no-build -- --headless --debug-page systems --width 2560 --height 1080 --screenshot artifacts/test-debug-systems.ppm
dotnet run --no-build -- --headless --debug-overlay --frames 2 --screenshot artifacts/test-debug-overlay.ppm
dotnet run --no-build -- --headless --story --smoke-lab-route
dotnet run --no-build -- --headless --smoke-carl-cutscene --frames 60 --screenshot artifacts/test-carl-cutscene.ppm
dotnet run --no-build -- --headless --smoke-control-phases
dotnet run --no-build -- --headless --smoke-objective-panel --story-time 1 --screenshot artifacts/test-objective-visible.ppm
dotnet run --no-build -- --headless --smoke-objective-panel --story-time 9 --screenshot artifacts/test-objective-hidden.ppm
dotnet run --no-build -- --headless --scene artifacts/extracted/VR04/scene.json --level gam/VR04.gam --smoke-jetpack --screenshot artifacts/test-jetpack.ppm
dotnet run --no-build -- --headless --scene artifacts/extracted/VR04/scene.json --level gam/VR04.gam --smoke-shrink-ray --screenshot artifacts/test-shrink-ray.ppm
dotnet run --no-build -- --headless --scene artifacts/extracted/VR03/scene.json --level gam/VR03.gam --smoke-invisible --screenshot artifacts/test-invisible.ppm
dotnet run --no-build -- --headless --scene artifacts/extracted/VR01/scene.json --level gam/VR01.gam --smoke-bubble --screenshot artifacts/test-bubble.ppm
dotnet run --no-build -- --headless --scene artifacts/extracted/VR07/scene.json --level gam/VR07.gam --smoke-baseball --screenshot artifacts/test-baseball.ppm
dotnet run --no-build -- --headless --scene artifacts/extracted/VR08/scene.json --level gam/VR08.gam --smoke-grappler --screenshot artifacts/test-grappler.ppm
dotnet run --no-build -- --headless --scene artifacts/extracted/VR02/scene.json --level gam/VR02.gam --smoke-rocketship --screenshot artifacts/test-rocketship.ppm
dotnet run --no-build -- --headless --scene artifacts/extracted/VR05/scene.json --level gam/VR05.gam --smoke-scooter --screenshot artifacts/test-scooter-vr05.ppm
dotnet run --no-build -- --headless --scene artifacts/extracted/level1/scene.json --level gam/level1.gam --start school1 --smoke-scooter --screenshot artifacts/test-scooter-outside.ppm
dotnet run --no-build -- --headless --skip-intro --write-save artifacts/test-checkpoint.tsk
dotnet run --no-build -- --headless --load-save artifacts/test-checkpoint.tsk --skip-intro
dotnet run --no-build -- --headless --story --scene artifacts/extracted/VR01/scene.json --level gam/VR01.gam --smoke-transition --skip-intro
dotnet run --no-build -- --headless --animation artifacts/extracted/animations/jimrun/animation.json --time 0 --screenshot artifacts/test-run-start.ppm
dotnet run --no-build -- --headless --animation artifacts/extracted/animations/jimrun/animation.json --frames 7 --screenshot artifacts/test-run-advanced.ppm
python3 - <<'PY'
from pathlib import Path
assert Path('artifacts/test-run-start.ppm').read_bytes() != Path('artifacts/test-run-advanced.ppm').read_bytes(), 'Animation did not advance in GPU readback'
print('PASS: original run preview advances across rendered frames')
PY
SDL_AUDIODRIVER=dummy dotnet run --no-build -- --effects-audio-smoke artifacts/extracted/effects/effects.json
SDL_AUDIODRIVER=dummy dotnet run --no-build -- --audio-smoke artifacts/extracted/sounds/Wave_00000001_save.wav
SDL_AUDIODRIVER=dummy dotnet run --no-build -- --scene-audio-smoke artifacts/extracted/level1b/entities/entities.json
SDL_AUDIODRIVER=dummy dotnet run --no-build -- --cutscene-audio-smoke artifacts/extracted/level1b/entities/entities.json
python3 tools/recon/inventory.py ../Original --verify docs/original-manifest.json
if [[ "${NEUTRON_WINDOW_TEST:-0}" == 1 ]]; then
dotnet run --no-build -- --scene artifacts/extracted/VR05/scene.json --level gam/VR05.gam --smoke-scooter --width 1920 --height 1080 --screenshot artifacts/test-scooter-vr05-window.ppm
dotnet run --no-build -- --scene artifacts/extracted/level1/scene.json --level gam/level1.gam --start school1 --smoke-scooter --width 1920 --height 1080 --screenshot artifacts/test-scooter-outside-window.ppm
dotnet run --no-build -- --scene artifacts/extracted/VR08/scene.json --level gam/VR08.gam --smoke-grappler --width 1920 --height 1080 --screenshot artifacts/test-grappler-window.ppm
dotnet run --no-build -- --scene artifacts/extracted/VR02/scene.json --level gam/VR02.gam --smoke-rocketship --width 1920 --height 1080 --screenshot artifacts/test-rocketship-window.ppm
dotnet run --no-build -- --scene artifacts/extracted/VR07/scene.json --level gam/VR07.gam --smoke-baseball --width 1920 --height 1080 --screenshot artifacts/test-baseball-window.ppm
dotnet run --no-build -- --scene artifacts/extracted/VR01/scene.json --level gam/VR01.gam --smoke-bubble --width 1920 --height 1080 --screenshot artifacts/test-bubble-window.ppm
dotnet run --no-build -- --scene artifacts/extracted/VR03/scene.json --level gam/VR03.gam --smoke-invisible --width 1920 --height 1080 --screenshot artifacts/test-invisible-window.ppm
dotnet run --no-build -- --smoke-gadget-menu --width 1920 --height 1080 --screenshot artifacts/test-gadget-menu-window.ppm
dotnet run --no-build -- --scene artifacts/extracted/VR04/scene.json --level gam/VR04.gam --smoke-shrink-ray --screenshot artifacts/test-shrink-ray-window.ppm
dotnet run --no-build -- --smoke-debug-tools
dotnet run --no-build -- --smoke-window-transitions
dotnet run --no-build -- --smoke-debug-overlay --screenshot artifacts/test-live-debug-window.ppm
dotnet run --no-build -- --smoke-debug-menu --screenshot artifacts/test-debug-window.ppm
dotnet run --no-build -- --smoke-objective-window --screenshot artifacts/test-objective-window.ppm
dotnet run --no-build -- --scene artifacts/extracted/VR04/scene.json --level gam/VR04.gam --smoke-jetpack --screenshot artifacts/test-jetpack-window.ppm
dotnet run --no-build -- --smoke-practice-window --frames 12 --screenshot artifacts/test-practice-window.ppm
dotnet run --no-build -- --scene artifacts/extracted/level1b/scene.json --smoke-window --frames 6 --screenshot artifacts/test-window.ppm
dotnet run --no-build -- --smoke-walk --screenshot artifacts/test-walk-window.ppm
fi
printf 'Complete local suite passed in %s seconds; fidelity Python/Node/observer counts verified positive.\n' "$((SECONDS - suite_started))"