Skip to content

test: lgb-diff label workflow - #13

Closed
mparrett wants to merge 4 commits into
mainfrom
test/lgb-diff-workflow
Closed

test: lgb-diff label workflow#13
mparrett wants to merge 4 commits into
mainfrom
test/lgb-diff-workflow

Conversation

@mparrett

Copy link
Copy Markdown
Owner

Fork-only test of the lgb-diff opt-in workflow. Payload = the nooga#600 VOID strip, so the expected sticky comment shows the -655 dead-pair bundle diff.

@mparrett mparrett added the lgb-diff post the core bundle bytecode diff as a sticky comment label Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

lgb-diff: pkg/rt/core_compiled.lgb vs merge-base 14e1746

unified diff (115 lines)
--- base (14e1746)
+++ head
@@ -1,4 +1,4 @@
-;; lgbdump: 13 namespaces, 2528 consts
+;; lgbdump: 13 namespaces, 2020 consts
 == main ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST core]
@@ -1877,7 +1877,6 @@
 [:LOAD_CONST core/with-out-str]
 [:INVOKE 1]
 [:RETURN]
-;; 272 no-value pairs suppressed
 == ns async ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST async]
@@ -1891,7 +1890,6 @@
 [:LOAD_CONST async/thread]
 [:INVOKE 1]
 [:RETURN]
-;; 6 no-value pairs suppressed
 == ns core ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST core]
@@ -3770,7 +3768,6 @@
 [:LOAD_CONST core/with-out-str]
 [:INVOKE 1]
 [:RETURN]
-;; 272 no-value pairs suppressed
 == ns edn ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST edn]
@@ -3797,7 +3794,6 @@
 [:LOAD_CONST [:fn pretty]]
 [:SET_VAR]
 [:RETURN]
-;; 9 no-value pairs suppressed
 == ns graph ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST graph]
@@ -3831,7 +3827,6 @@
 [:LOAD_CONST [:fn reachable]]
 [:SET_VAR]
 [:RETURN]
-;; 20 no-value pairs suppressed
 == ns hash ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST hash]
@@ -3865,7 +3860,6 @@
 [:LOAD_CONST [:fn xxh3-hasher-seed]]
 [:SET_VAR]
 [:RETURN]
-;; 7 no-value pairs suppressed
 == ns io ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST io]
@@ -3875,7 +3869,6 @@
 [:LOAD_CONST [:fn slurp-lines]]
 [:SET_VAR]
 [:RETURN]
-;; 2 no-value pairs suppressed
 == ns let-go.core ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST let-go.core]
@@ -3899,7 +3892,6 @@
 [:LOAD_CONST [:fn range?]]
 [:SET_VAR]
 [:RETURN]
-;; 10 no-value pairs suppressed
 == ns let-go.semver ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST let-go.semver]
@@ -4066,7 +4058,6 @@
 [:LOAD_CONST [:fn require-letgo]]
 [:SET_VAR]
 [:RETURN]
-;; 44 no-value pairs suppressed
 == ns pprint ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST pprint]
@@ -4098,7 +4089,6 @@
 [:MAKE_MULTI_ARITY 2]
 [:SET_VAR]
 [:RETURN]
-;; 1 no-value pairs suppressed
 == ns set ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST set]
@@ -4154,7 +4144,6 @@
 [:LOAD_CONST [:fn map-invert]]
 [:SET_VAR]
 [:RETURN]
-;; 2 no-value pairs suppressed
 == ns string ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST string]
@@ -4267,7 +4256,6 @@
 [:LOAD_VAR core/subs]
 [:SET_VAR]
 [:RETURN]
-;; 8 no-value pairs suppressed
 == ns test ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST test]
@@ -4391,10 +4379,7 @@
 [:LOAD_CONST test/use-fixtures]
 [:LOAD_CONST [:fn use-fixtures]]
 [:SET_VAR]
-[:POP]
-[:LOAD_CONST [:opaque "VOID"]]
 [:RETURN]
-;; 1 no-value pairs suppressed
 == ns walk ==
 [:LOAD_VAR core/in-ns]
 [:LOAD_CONST walk]

mparrett and others added 4 commits July 20, 2026 18:19
The reader surfaces comments, #_ discards, and empty reader conditionals
as the VOID sentinel. Every read loop filters it — collections via
appendNonVoid, read-string via ReadSkipNoValue — except CompileMultiple,
which compiled each one like a real form. Two consequences: a dead
LOAD_CONST/POP pair per top-level comment in every chunk (655 pairs in
the shipped core bundle, executed on each boot), and a trailing comment
clobbering the last value, so (load-string "42 ;; done") returned VOID
instead of 42.

Skip VOID forms in the read loop. Comment-only input still evaluates to
VOID (not nil) so the REPL keeps echoing nothing for a comment-only line.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
264,072 -> 258,947 bytes (-1.9%); the 655 LOAD_CONST VOID / POP pairs
are gone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dumps a .lgb as deterministic text (via disasm/decode-bundle +
disassemble-resolved) so bundle changes can be read and diffed:

    diff -u <(./lg scripts/lgbdump.lg old.lgb) <(./lg scripts/lgbdump.lg new.lgb)

Three choices aim at diff quality: resolved LOAD_CONST/LOAD_VAR rows
print only the referenced identifier (a pool insertion shifts every
later index, turning a one-fn change into a whole-bundle diff — 16.7k
noise lines vs 763 real ones on the nooga#558 bundle bump); anonymous fns get
a bare label for the same reason; and the LOAD_CONST-VOID/POP pairs that
top-level comments compile to (nooga#600 removes them) collapse to one count
line per chunk.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Label a PR lgb-diff and a sticky comment carries the unified diff of two
lgbdump renderings of pkg/rt/core_compiled.lgb (head vs merge-base),
refreshed on each push. The diff itself is plain diff -u in the runner;
the script stays dump-only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mparrett
mparrett force-pushed the test/lgb-diff-workflow branch from eb1d50b to fc0720b Compare July 21, 2026 01:20
@mparrett mparrett closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgb-diff post the core bundle bytecode diff as a sticky comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant