Skip to content

dev: port restoHack's sanitizer/soak harness - #14

Merged
Critlist merged 4 commits into
mainfrom
dev/soak-runner
Oct 12, 2026
Merged

Critlist merged 4 commits into
mainfrom
dev/soak-runner

Conversation

@Critlist

Copy link
Copy Markdown
Owner

Ports restoHack's dev/ harness, as of master faa0110 (#22, #24), to protoHack, so protoHack can be soaked before the next release. Merge #13 first: this branch includes its commit, so the harness tests the fixed resize redraw.

What's ported and what changed

Area restoHack protoHack
Lanes ASan, UBSan, ASan+UBSan, hardened Same. Hardened is -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=3 with full RELRO, and no PIE, because CMakeLists.txt forces -fno-pie/-no-pie
Options --seed-offset, --only-run, --tolerate-failure-percent, failure checks Unchanged
Seeding HACK_SEED with -DHACK_TEST_SEED Added to main(); test builds only
Runner restoHack prompts, -D New lib/game_runner.py, same interface
libFuzzer step yes Dropped: its targets are restoHack-specific

The protoHack runner:

  • reads the screen with pyte;
  • walks by BFS to a visible >, or to the nearest unexplored edge, so runs reach levels 2–5 instead of staying on 1;
  • sends keys aimed at the S1 fixes: ^R, o and c with long, comma and % text;
  • in --enhanced, saves (S) or hangs up and checks the restore, and resizes below 80x24;
  • starts a fresh game after a death;
  • quits by reading the screen.

A simulated hangup also closes the pty, as a real one does: the game's SIGHUP handler only sets a flag that it acts on at the next read.

Found while porting

Verification

run-all.py --runs 3 --steps 1500 --enhanced --seed-offset 11, all 4 lanes, with #13 included: 10/12 passed.

  • Every save, hangup and resize restored cleanly.
  • No sanitizer reports.
  • Deepest level 5.

The 2 failures were the harness's old blind quit sequence: a jackal fight's --More-- and an "eat what?" prompt swallowed the Q. With the screen-aware quit, both runs (--only-run) pass.

Not covered yet: a full overnight soak, which is the next step: uv run ./run-all.py --runs 100 --steps 1000 --enhanced --seed-offset $(date +%s).

🤖 Generated with Claude Code

Critlist and others added 4 commits October 11, 2026 19:13
check_resize() only called docrt() when the size differed from
last_cols/last_rows, which the too-small loop never updates. Shrinking
the terminal and restoring the same 80x24 left the warning on screen
over a stale map. Found by the soak harness port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dev/lib + run-{asan,ubsan,asan-ubsan,hardened,all}.py from restoHack
master (faa0110), adapted: protoHack build flags (no PIE: CMakeLists
forces -fno-pie), no -D flag, no libFuzzer step, and a protoHack
game_runner (pyte screen, BFS stair seeking, targeted keys for the S1
fixes, save/hangup + restore, resize, new game after death).
HACK_SEED seeds the RNG in -DHACK_TEST_SEED builds only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; docs

- quit reads the screen (dismiss --More--, cancel prompts, then Q):
  blind ' ' passed turns and new --More-- pages swallowed the Q
- restore check looks only at the respawned game's output
- a TERMINAL TOO SMALL screen still up after restoring 80x24 fails
  the run (the bug fixed in #13)
- dev/README.md: lanes, what a run does, soak recipe, replay
- CHANGELOG entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Critlist
Critlist merged commit 2b48cf7 into main Oct 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant