From 7541640ebc3797ac574d52b1469c93af1d201866 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sat, 29 Aug 2026 23:13:53 -0700 Subject: Add update_head_reference.sh: automate the head_reference checkpoint ritual, so it actually happens instead of being forgotten. Refreshing head_reference/ (rebuild release binary, sd10+sn5m sweep across all three curated suites, copy logs, tag the commit, archive the binary) was, until now, a several-minute manual dance repeated by hand every time a commit became the new comparison baseline -- exactly the kind of multi-step ritual an AI assistant with no persistent memory across sessions will reliably forget to fully repeat. Scripted the mechanical parts: build, 6-way sweep, log copy, git tag (head- reference-, the durable/versioned source of truth for "which commit was checkpoint N" -- see head_reference/README.md's new "Checkpoint history convention" section), and binary archive (a rebuild-avoidance cache alongside the tag, not a replacement for it). Does NOT write the README's prose sections (what changed, why, how to read the net score) -- that still needs a human/Claude actually looking at the diff and the numbers this script prints at the end, not a template trying to guess at them. Checks for a dirty working tree and warns rather than silently tagging something that doesn't correspond to a real commit -- the intended sequence is still git commit first, then this script, same as precommit_check.sh's gate runs before a commit rather than replacing it. precommit_check.sh: two lines printing the actual next-step commands ("git commit", "./update_head_reference.sh") after a passing check, so the two scripts' relationship is visible right where the first one succeeds. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01M9ZDiJhiUajUxh95mTXCFJ --- src/dna/first.dna | 56 ++++++++++++++++++++++++++ src/dna/original_baseline.dna | 56 ++++++++++++++++++++++++++ src/precommit_check.sh | 2 + src/update_head_reference.sh | 94 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 208 insertions(+) create mode 100644 src/dna/first.dna create mode 100644 src/dna/original_baseline.dna create mode 100755 src/update_head_reference.sh diff --git a/src/dna/first.dna b/src/dna/first.dna new file mode 100644 index 0000000..a960faf --- /dev/null +++ b/src/dna/first.dna @@ -0,0 +1,56 @@ +-1,90,89,89,59,46,25,4,50,50,50,50,50,50,50,50,-1,-1,125,125,109,132,123,100,78,71,66,66,66,66,66,66,66,-1,-1,158,180,148,92,109,70,46,87,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0,0,0,0,0,0,0,0,-12,7,7,-27,-27,7,7,-12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,-32,-41,-91,-102,-170,-207,-222,-250,0,-7,1,-76,-76,-120,-184,-200,-216,0,-21,-7,-18,-30,-48,-78,-111,-138,0,-7,-21,-25,-31,-47,-57,-95,-121 +16,5,-7,-33,-32,-19,-34,-85,-100 +0,1,-24,-9,-18,-18,-9,-24,1 +-5 +13 +0,0,194,135,54,20,-6,-3,0,0,0,-3,-6,20,54,135,194,0 +0,0,0,48,42,14,21,17,0,0,0,17,21,14,42,48,0,0 +0,0,80,58,56,29,10,21,0,0,0,21,10,29,56,58,80,0 +0,0,92,80,21,6,11,1,0,0,0,1,11,6,21,80,92,0 +0,0,15,30,21,28,34,41,55 +92,-1,-1,53,-1,3,19,-1,6,9,12,-4,-5,-5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 +784 +-8,-14,-10,-24,-38 +1 +-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,21,68,51,34,41,48,55,37,59,57,40,40,40,40,40,40,40 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-20,-14,-7,-7,-7,-7,-14,-20,0,0,0,0,0,0,0,0,-14,-7,-17,-8,-8,-17,-7,-14,0,0,0,0,0,0,0,0,-7,-8,-10,-11,-11,-10,-8,-7,0,0,0,0,0,0,0,0,-7,-8,-10,-11,-11,-10,-8,-7,0,0,0,0,0,0,0,0,-14,-7,-17,-8,-8,-17,-7,-14,0,0,0,0,0,0,0,0,-20,-14,-7,-7,-7,-7,-14,-20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-2,-2,-2,-2,-1,-1,0,0,0,0,0,0,0,0,-11,-4,-4,-4,-4,-4,-4,-11,0,0,0,0,0,0,0,0,-4,-5,1,-16,-16,1,-5,-4,0,0,0,0,0,0,0,0,-4,-5,1,-16,-16,1,-5,-4,0,0,0,0,0,0,0,0,-11,-4,-4,-4,-4,-4,-4,-11,0,0,0,0,0,0,0,0,-1,-1,-2,-2,-2,-2,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +-38,-22,-26,-13,-9,0,1,11,4,13,22,15,40,-7 +-18,4,9,3,12,-3,-3,-3 +8,1,36,26,32,-12,8,-26,-16 +2,2,2,17,17,8,8,7,7,-2,13,20,3,18,9,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16 +-60,-16,-16,-16,-16,-16,-16,-60,0,0,0,0,0,0,0,0,-16,-2,-2,0,0,-2,-2,-16,0,0,0,0,0,0,0,0,-16,-2,-4,13,13,-4,-2,-16,0,0,0,0,0,0,0,0,-16,-2,13,16,16,13,-2,-16,0,0,0,0,0,0,0,0,-16,-2,13,16,16,13,-2,-16,0,0,0,0,0,0,0,0,-16,-2,-4,13,13,-4,-2,-16,0,0,0,0,0,0,0,0,-16,-2,-2,0,0,-2,-2,-16,0,0,0,0,0,0,0,0,-60,-16,-16,-16,-16,-16,-16,-60,0,0,0,0,0,0,0,0 +8,-9,12,1,12,8,8,8,8 +-24,9,11,38,14,-24,-24,-24,-24 +-8,4,27,25,22,3,-8,-8,-8,-8,-8,-8,-8,3,22,25,27,4 +-33,-18,-14,-8,-5,5,15,8,8 +16,12,0 +8,8,8,8,8,8,8,8,8,8,9,18,4,6,17,-13,12,5,-17,1,19,-3,-3,30,30,23,23,24,24,25,25,26,27 +48,38,41,38,29,29,20,20 +12,11,17,17,32,32,32,15 +-3,12,11,11,17,17,17,16 +-24,-24,41,17,4,-2,-31,-24,-24,-24,-24,-24,-31,-2,4,17,41,-24 +0,0,-54,-16,11,-9,19,-3,0,0,0,-3,19,-9,11,-16,-54,0 +-48 +46 +7,35,92,46,33,-5,-10,16,-17,-15,-27,-38,-57,-44,-42,-70,-41 +7 +4 +-36,-16,-20,-14,-7,-10,0,4,8,12,15,9,19,13,14 +1,10,8,12,8,8,8,8 +-54,-34,-22,-17,-19,-8,-4,-2,7,10,12,15,18,4,30,31,32,41,42,35,36,36,21,21,6,6,7,7 +0,-14,-6,-2,-25 +0,34,76,30,27,9,8,-1 +-8 +1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0 +-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-23,3,5,-1,-1,5,3,-23,-32,-32,-32,-32,-32,-32,-32,-32,3,5,13,15,15,13,5,3,-32,-32,-32,-32,-32,-32,-32,-32,5,-1,41,31,31,41,-1,5,-32,-32,-32,-32,-32,-32,-32,-32,5,-1,41,31,31,41,-1,5,-32,-32,-32,-32,-32,-32,-32,-32,3,5,13,15,15,13,5,3,-32,-32,-32,-32,-32,-32,-32,-32,-23,3,5,-1,-1,5,3,-23,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32,-32 +0,-4,-40,-28,-24,-28,-33,-39,-30,-50,-55,-60,-90,-97,-104,-135,-150,-141,-148,-211,-210,-217,-240,-255,-286,-306,-262,-330,-350,-386,-390,-378,-448,-462,-508,-508,-508,-508,-508,-508,-508,-508 +9 \ No newline at end of file diff --git a/src/dna/original_baseline.dna b/src/dna/original_baseline.dna new file mode 100644 index 0000000..76d7689 --- /dev/null +++ b/src/dna/original_baseline.dna @@ -0,0 +1,56 @@ +-1,90,81,73,67,62,57,52,50,50,50,50,50,50,50,50,-1,-1,125,117,109,100,91,84,78,71,66,66,66,66,66,66,66,-1,-1,150,132,124,116,109,102,94,87,77,77,77,77,77,77,77,-1 +-43,-15,0,3,6,10,15,21,28,-63,-25,0,4,9,14,19,25,32,-10,0,0,7,15,20,24,29,36 +0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,3,4,5,6,6,7,7,7,7,8,8,8,8,8,8,8,8 +8,8,8,8,8,8,8,8,8,7,7,7,7,6,6,5,4,3,3,3,2,2,2,1,1,1,0,0,0,0,0,0 +8,8,8,8,8,8,7,7,7,6,7,5,4,5,4,3,2,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-8,0,0,0,0,0,0,-8,0,0,0,0,0,0,0,0,-8,0,5,5,5,5,0,-8,0,0,0,0,0,0,0,0,-8,0,5,9,9,5,0,-8,0,0,0,0,0,0,0,0,-8,0,5,9,9,5,0,-8,0,0,0,0,0,0,0,0,-8,0,5,5,5,5,0,-8,0,0,0,0,0,0,0,0,-8,0,0,0,0,0,0,-8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-7,-5,-5,-7,-7,-5,-5,-7,0,0,0,0,0,0,0,0,-5,-4,-4,-5,-5,-4,-4,-5,0,0,0,0,0,0,0,0,-4,-3,-3,-4,-4,-3,-3,-4,0,0,0,0,0,0,0,0,-4,-3,-3,-4,-4,-3,-3,-4,0,0,0,0,0,0,0,0,-5,-4,-4,-5,-5,-4,-4,-5,0,0,0,0,0,0,0,0,-7,-5,-5,-7,-7,-5,-5,-7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-12,-9,-9,-11,-11,-9,-9,-12,0,0,0,0,0,0,0,0,-9,-7,-7,-9,-9,-7,-7,-9,0,0,0,0,0,0,0,0,-7,-6,-6,-7,-7,-6,-6,-7,0,0,0,0,0,0,0,0,-7,-6,-6,-7,-7,-6,-6,-7,0,0,0,0,0,0,0,0,-9,-7,-7,-9,-9,-7,-7,-9,0,0,0,0,0,0,0,0,-12,-9,-9,-11,-11,-9,-9,-12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,-32,-65,-99,-134,-170,-207,-222,-250,0,-23,-47,-76,-108,-144,-184,-200,-216,0,-13,-23,-34,-46,-64,-86,-111,-138,0,-7,-13,-25,-39,-55,-73,-95,-121 +0,-3,-7,-9,-16,-35,-50,-85,-100 +0,-7,-8,-9,-10,-10,-9,-8,-7 +-5 +-11 +0,0,162,111,62,36,18,13,0,0,0,13,18,36,62,111,162,0 +0,0,0,48,34,22,13,9,0,0,0,9,13,22,34,48,0,0 +0,0,96,74,48,21,10,5,0,0,0,5,10,21,48,74,96,0 +0,0,60,40,13,6,3,1,0,0,0,1,3,6,13,40,60,0 +0,0,7,14,21,28,34,41,55 +60,-1,-1,37,-1,43,19,-1,14,9,20,4,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +800 +0,-6,-10,-16,-22 +33 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,52,51,50,49,48,47,45,43,41,40,40,40,40,40,40,40 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4,-6,-7,-7,-7,-7,-6,-4,0,0,0,0,0,0,0,0,-6,-7,-9,-8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,0,0,0,0,3,6,9,11,12 +-17,-10,-6,0,3,5,7,8,8 +0,4,8 +0,0,0,0,0,0,0,0,0,0,1,2,4,6,9,11,12,13,15,17,19,21,21,22,22,23,23,24,24,25,25,26,27 +24,22,17,14,13,13,12,12 +12,11,9,9,8,8,8,7 +13,12,11,11,9,9,9,8 +0,0,25,17,12,6,1,0,0,0,0,0,1,6,12,17,25,0 +0,0,-22,-16,-13,-9,-5,-3,0,0,0,-3,-5,-9,-13,-16,-22,0 +-40 +22 +55,51,44,38,33,27,22,16,7,1,-3,-6,-9,-12,-18,-22,-25 +7 +4 +-28,-24,-20,-14,-7,-2,0,4,8,12,15,17,19,21,22 +-15,-6,0,4,8,8,8,8 +-30,-26,-22,-17,-11,-8,-4,-2,-1,2,4,7,10,12,14,15,16,17,18,19,20,20,21,21,22,22,23,23 +0,-14,-22,-26,-33 +0,34,28,22,19,17,16,15 +8 +1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,5,7,7,5,3,1,0,0,0,0,0,0,0,0,3,5,13,15,15,13,5,3,0,0,0,0,0,0,0,0,5,7,17,23,23,17,7,5,0,0,0,0,0,0,0,0,5,7,17,23,23,17,7,5,0,0,0,0,0,0,0,0,3,5,13,15,15,13,5,3,0,0,0,0,0,0,0,0,1,3,5,7,7,5,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,-4,-8,-12,-16,-20,-25,-31,-38,-50,-63,-76,-90,-105,-120,-135,-150,-165,-180,-195,-210,-225,-240,-255,-270,-290,-310,-330,-350,-370,-390,-410,-440,-470,-500,-500,-500,-500,-500,-500,-500,-500 +-23 diff --git a/src/precommit_check.sh b/src/precommit_check.sh index ccf0089..c2d7d41 100755 --- a/src/precommit_check.sh +++ b/src/precommit_check.sh @@ -69,3 +69,5 @@ if [ "$FAIL" -ne 0 ]; then exit 1 fi echo "PRE-COMMIT CHECK PASSED" +echo "git commit" +echo "./update_head_reference.sh" diff --git a/src/update_head_reference.sh b/src/update_head_reference.sh new file mode 100755 index 0000000..1303080 --- /dev/null +++ b/src/update_head_reference.sh @@ -0,0 +1,94 @@ +#!/bin/sh +# Refresh ../head_reference/ (binary + logs + git tag + binary archive) +# to point at the current commit. Run by hand after deciding a commit is +# the new comparison baseline -- NOT automatic, same reasoning as +# precommit_check.sh (rebuild cost, binary-clobbering risk). +# +# Automates the mechanical part of what was, until 2026-08-29, a several- +# minute manual dance repeated by hand every time: rebuild release, +# sd10+sn5m sweep across all three curated suites (6 runs), copy logs, +# tag the commit so "match_play current head vs. last head" is actually +# possible later, archive the binary so that comparison doesn't require +# a rebuild-from-tag first. Does NOT write head_reference/README.md's +# prose sections (what changed, why, net-score interpretation) -- that +# needs a human/Claude actually looking at the diff and the numbers this +# script prints, not a template. +# +# Usage: ./update_head_reference.sh + +cd "$(dirname "$0")" || exit 1 +HEADREF=../head_reference +TESTS=../tests +LOGDIR=/tmp/typhoon/update_head_reference +mkdir -p "$LOGDIR" "$HEADREF/logs" "$HEADREF/archive" + +if [ ! -d "$HEADREF" ]; then + echo "ERROR: $HEADREF doesn't exist (expected sibling of src/)" + exit 1 +fi + +HASH=$(git rev-parse --short HEAD) +if ! git diff --quiet || ! git diff --cached --quiet; then + echo "WARNING: working tree has uncommitted changes -- the binary/tag" + echo " below will still be built from the working tree as-is," + echo " but the tag will point at HEAD ($HASH), which won't" + echo " match what actually got built. Commit first if you" + echo " want the tag to be trustworthy." + echo +fi + +echo "=== [1/3] Building release binary ($HASH) ===" +STEP_START=$(date +%s) +gmake clean > "$LOGDIR/clean.log" 2>&1 +gmake -j5 GENETIC=1 PERF_COUNTERS=1 MP=1 SIXTYFOUR=1 > "$LOGDIR/build.log" 2>&1 +if [ $? -ne 0 ]; then + echo " BUILD FAILED -- see $LOGDIR/build.log" + exit 1 +fi +cp typhoon "$HEADREF/typhoon" +echo " [$(( $(date +%s) - STEP_START ))s]" + +echo "=== [2/3] sd10 + sn5M sweep, 3 curated suites (6 runs, parallel) ===" +STEP_START=$(date +%s) +for suite in ecm_ringers ecm_confident_quick ecm_hard_quick; do + ./typhoon --cpus 1 --hash 256m --logfile "$LOGDIR/sd10_${suite}.log" \ + --batch --command "force; book name /nonexistent.book.bin; sd 10; script $TESTS/${suite}.ep_" \ + > "$LOGDIR/sd10_${suite}.out" 2>&1 & + ./typhoon --cpus 1 --hash 256m --logfile "$LOGDIR/sn5m_${suite}.log" \ + --batch --command "force; book name /nonexistent.book.bin; sn 5000000; script $TESTS/${suite}.ep_" \ + > "$LOGDIR/sn5m_${suite}.out" 2>&1 & +done +wait +echo " [$(( $(date +%s) - STEP_START ))s]" + +cp "$LOGDIR"/sd10_*.log "$LOGDIR"/sd10_*.out "$LOGDIR"/sn5m_*.log "$LOGDIR"/sn5m_*.out "$HEADREF/logs/" + +echo "=== [3/3] Tagging + archiving ===" +TAGNAME="head-reference-$(date +%Y%m%d)" +if git rev-parse -q --verify "refs/tags/$TAGNAME" >/dev/null; then + echo " tag $TAGNAME already exists (probably re-run same day) -- leaving it, not overwriting" +else + git tag -a "$TAGNAME" -m "head_reference checkpoint (see head_reference/README.md)" "$HASH" + echo " tagged $TAGNAME -> $HASH (local only -- push with 'git push origin $TAGNAME' if wanted)" +fi +cp "$HEADREF/typhoon" "$HEADREF/archive/typhoon-$HASH" +echo " archived $HEADREF/archive/typhoon-$HASH" + +echo +echo "=== Summary (fold into head_reference/README.md by hand) ===" +printf "%-22s %10s %10s\n" "Suite" "sd10" "sn5M" +sd10_total_s=0; sd10_total_n=0; sn5m_total_s=0; sn5m_total_n=0 +for suite in ecm_ringers ecm_confident_quick ecm_hard_quick; do + s10=$(grep -c "solved in" "$LOGDIR/sd10_${suite}.out") + n10=$(grep -c "not solved" "$LOGDIR/sd10_${suite}.out") + s5m=$(grep -c "solved in" "$LOGDIR/sn5m_${suite}.out") + n5m=$(grep -c "not solved" "$LOGDIR/sn5m_${suite}.out") + printf "%-22s %4s/%-5s %4s/%-5s\n" "$suite" "$s10" "$((s10+n10))" "$s5m" "$((s5m+n5m))" + sd10_total_s=$((sd10_total_s+s10)); sd10_total_n=$((sd10_total_n+s10+n10)) + sn5m_total_s=$((sn5m_total_s+s5m)); sn5m_total_n=$((sn5m_total_n+s5m+n5m)) +done +printf "%-22s %4s/%-5s %4s/%-5s\n" "TOTAL" "$sd10_total_s" "$sd10_total_n" "$sn5m_total_s" "$sn5m_total_n" +echo +echo "Reminder: head_reference/README.md still needs manual editing --" +echo "commit hash/message, what changed and why, net-score interpretation." +echo "This script only refreshed the binary, logs, tag, and archive." -- cgit v1.3