test(divergence): flip load-toplevel-echo to a hard agreement (#40)#16
Merged
Conversation
…n-lua#40) Bifrost surfaced a real divergence found while running a Shen spec across shen-rust/shen-go/shen-lua: the canonical kernel load (klambda/load.kl shen.eval-and-print) prints each toplevel form's value before returning `loaded`. shen-rust and shen-go do; shen-lua does on a cold fasl cache / SHEN_FASL=off but DROPS the echo on a warm fasl-cache hit (documented degrade, boot.lua ~796). So (load file) stdout is cache-state dependent -- a cross-port divergence and an intra-port nondeterminism. - programs/load-echo-probe.shen: minimal probe ("PROBE" / (+ 40 2) / (define p)) - cases/divergences.json: load-toplevel-echo, mode eval, expect agreement + known_divergence shen-lua-fasl-load-echo (reports DIVERGE, not FAIL, until it converges -- then drop the marker for a hard agreement, as hush-file-write did) Verified: bifrost --only load-toplevel-echo across shen-rust,shen-go,shen-lua reports KNOWN DIVERGENCE: '"PROBE"\n42\n\nloaded' <- shen-go,shen-rust vs 'loaded' <- shen-lua. Filed pyrex41/shen-lua#40 with root cause + fix options. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
shen-lua's warm-fasl `(load)` echo divergence is fixed (pyrex41/shen-lua#40, PR #41): a warm cache hit now re-emits each top-level form's value, so `(load FILE)` stdout no longer depends on cache state and agrees with shen-rust/ shen-go cold and warm. Drop the `known_divergence` marker so the case is now a HARD agreement (a real FAIL if any port regresses), mirroring the lifecycle hush-file-write went through. Doc updated to RESOLVED with the PR ref. Also complete the run-time banner strip in normalize(): the kernel banner is `(cn "\nrun time: " ...)`, whose leading newline leaves a BLANK line ahead of the text line. We stripped only the text, so the residual blank diverged against a port that omits the whole banner (shen-lua on a warm hit re-emits the value echo but not the cosmetic banner). Drop that blank too, so the entire cosmetic banner is normalized away symmetrically across ports. README: refresh the divergence status (load-toplevel-echo now resolved; the list is all hard agreements) and a light intro trim. Verified: full corpus 31 pass / 0 diverge / 0 FAIL across shen-rust, shen-go, shen-lua, on both warm and cold shen-lua fasl caches. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Companion to pyrex41/shen-lua#41 (fixes pyrex41/shen-lua#40).
What
shen-lua's warm-fasl(load)echo divergence is fixed: a warm cache hit now re-emits each top-level form's value, so(load FILE)stdout no longer depends on cache state and agrees with shen-rust / shen-go on both cold and warm caches.known_divergence: shen-lua-fasl-load-echofromload-toplevel-echo, so a disagreement is now a real FAIL rather than a documented DIVERGE — the same lifecyclehush-file-writewent through. Doc updated to RESOLVED with the PR ref.normalize(). The kernel banner is(cn "\nrun time: " ...); its leading newline leaves a blank line ahead of the text line. We stripped only the text, leaving the blank as residue — which diverged against a port that omits the whole banner (shen-lua on a warm hit re-emits the value echo but not the cosmetic banner). Now the blank preceding a strippedrun time:line is dropped too, so the entire cosmetic banner normalizes away symmetrically across ports. (Harmless for ports that emit the banner — the strip is symmetric.)load-toplevel-echonow resolved; the list is all hard agreements) + a light intro trim.The first commit (
test(divergence): add load-toplevel-echo cross-port case) is the tracking case; it was authored on a sibling branch and is cherry-picked here so this PR is self-contained againstmain.Verification
Full corpus 31 pass / 0 diverge / 0 FAIL across shen-rust, shen-go, shen-lua — on both a warm and a cold shen-lua fasl cache:
🤖 Generated with Claude Code