Skip to content

chore(demo): refresh demo.sh to tour all features (+ an infer fix it surfaced) - #29

Merged
scottvr merged 1 commit into
mainfrom
chore/demo-refresh
Aug 24, 2026
Merged

chore(demo): refresh demo.sh to tour all features (+ an infer fix it surfaced)#29
scottvr merged 1 commit into
mainfrom
chore/demo-refresh

Conversation

@scottvr

@scottvr scottvr commented Aug 24, 2026

Copy link
Copy Markdown
Owner

scripts/demo.sh predated ~8 features (it was written before infer, profile, compose axes, --rgb, text mode, --find, diff, --term existed). This refreshes it into a full guided tour over the bundled sample data, salvaging the useful commands from the broken scripts/demo2-wip.sh and deleting both it and the redundant .txt duplicate scripts/demo-sh.txt.

The demo earned its keep

Running the fuller tour surfaced a real infer bug on the 188-byte sync-record sample: an arithmetic payload autocorrelates strongly at a wrong lag (181), so select_stride picked 181, found no constant columns, and bailed as "variable-length text" — never trying the sparse-marker detector (which is gated behind flat autocorrelation).

Fix: when the autocorrelation-chosen stride has frac==0, fall back to the marker detector before giving up. records.bin now infers stride 188 via its 0x47 sync, and even says why:

stride 188 bytes (sparse marker: byte 0x47 recurs every 188 bytes at offset 0 (autocorrelation peaked spuriously at 181)); 400 records

+1 regression test; textlog/random negatives still correctly rejected.

Also

  • Documents the block-diff alignment caveat (--block) in the README — the demo's first (odd-sized-insertion) diff smeared into 280 regions until block-aligned; now a clean 2-region diff.
  • Demo runs clean end-to-end (bash scripts/demo.sh, exit 0).
  • ruff + mypy clean; 164 tests green.

🤖 Generated with Claude Code

…aced

Rewrite scripts/demo.sh so it demonstrates the whole current tool -- infer (+ struct/kaitai/json export), profile, compose axes (-t/--paint), --rgb, text mode, --find, inspect readouts, diff, --term -- not just the six commands it had from before all of those existed. Delete the redundant scripts/demo-sh.txt (a .txt duplicate) and the broken scripts/demo2-wip.sh, salvaging its useful commands into demo.sh.

Running the fuller demo surfaced a real infer bug: on the 188-byte sync-record sample, an arithmetic payload autocorrelates strongly at a WRONG lag (181), so select_stride picked 181, found no constant columns, and gave up as 'variable-length text' -- never trying the sparse-marker detector (gated behind flat autocorrelation). Fix: when the autocorrelation stride has frac==0, fall back to the marker detector before concluding it's text. records.bin now infers stride 188 via the 0x47 sync. +1 test.

Also documents the block-diff alignment caveat (--block) in the README, which the demo's first (odd-sized-insertion) diff exposed.
@scottvr
scottvr merged commit 515edc0 into main Aug 24, 2026
6 checks passed
@scottvr
scottvr deleted the chore/demo-refresh branch August 24, 2026 05:37
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