chore(demo): refresh demo.sh to tour all features (+ an infer fix it surfaced) - #29
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scripts/demo.shpredated ~8 features (it was written beforeinfer,profile, compose axes,--rgb,textmode,--find,diff,--termexisted). This refreshes it into a full guided tour over the bundled sample data, salvaging the useful commands from the brokenscripts/demo2-wip.shand deleting both it and the redundant.txtduplicatescripts/demo-sh.txt.The demo earned its keep
Running the fuller tour surfaced a real
inferbug on the 188-byte sync-record sample: an arithmetic payload autocorrelates strongly at a wrong lag (181), soselect_stridepicked 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.binnow infers stride 188 via its0x47sync, and even says why:+1 regression test; textlog/random negatives still correctly rejected.
Also
diffalignment 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.bash scripts/demo.sh, exit 0).🤖 Generated with Claude Code