Skip to content

Retarget shaker to Tarver's refreshed S41.2 kernel (lineage switch)#10

Merged
pyrex41 merged 2 commits into
mainfrom
kernel/tarver-s41-refresh-20260711
Jul 14, 2026
Merged

Retarget shaker to Tarver's refreshed S41.2 kernel (lineage switch)#10
pyrex41 merged 2 commits into
mainfrom
kernel/tarver-s41-refresh-20260711

Conversation

@pyrex41

@pyrex41 pyrex41 commented Jul 14, 2026

Copy link
Copy Markdown
Owner

What

Switches the vendored kernel from community ShenOSKernel-41.2 to Mark Tarver's refreshed S41.2 (shenlanguage.org, re-uploaded in place 2026-07-11; canonical mirror pyrex41/shen-s41.1 tag s41.2-pristine-20260711, commit 11fc51b) and adapts stage 1 to its new architecture.

Upstream delta (vs community 41.2)

  • 15-file KLambda set: backend.kl new (the cl.* KL→Lisp compiler, in-kernel); compiler.kl/dict.kl/init.kl/stlib.kl/extension-*.kl gone
  • dicts → property vector (*property-vector*, plain absvector)
  • no shen.initialise — init is toplevel forms (declarations.kl sets/arity/externals/lambda-table + types.kl 161 declares); boot order is install.lsp's (types last), which is the authoritative linear .kl load order
  • 672 shared defuns: 156 modified (incl put get arity bootstrap read macroexpand), 21 new, ~26 core removals
  • kernel boot surface: 683 defuns / 2,568 call edges (community: 1,152 / ~5,000)

Shaker adaptation

  • collects kernel toplevel forms, seeds reachability from them, and synthesises (defun shen.initialise () ...) — emitted kernel.kl contains defuns only (verified 0 raw toplevel forms), so builder overrides → init → user ordering is safe, and the manifest init=shen.initialise contract is unchanged
  • eval-strip: blanks *macros*, drops the declares, and replaces the eval-kl-at-boot (shen.build-lambda-table (external shen)) with a literal (set shen.*lambdatable* ...) of deterministic eta-wrappers (X1..Xn) restricted to footprint ∩ arity-table — slices stay needs-eval=false / cannot-reach=eval
  • declare treated as data (declared name is a table key, not a call)
  • fix (8ae561a): load-call-graph now restores the defp marks — a cache-hit shake previously seeded nothing from the init forms and silently under-shook (metaeval 306 instead of 548 defuns; lua's native fallbacks masked it, the rust boot in the parity gate caught it). Cache-hit and cache-miss shakes verified byte-identical.
  • manifest kernel-version=41.2-s41r.20260711 (builders warn, don't fail); callgraph cache renamed; provenance rewritten citing the mirror

Status — all four wired targets green

stage result
shake (shen-cl host, cross-lineage) ✅ fib/hello/prolog/parity/metaeval; cache-hit == cache-miss byte-identical
lua (pyrex41/shen-lua#36) ✅ fib/hello/prolog + metaeval
rust (pyrex41/shen-rust#9) ✅ parity gate
go (pyrex41/shen-go#18) ✅ fib + metaeval (closes their stage-2 caveat)
js (ShenScript kernel-refresh branch) ✅ fib + metaeval (--linked); regenerated test/ratatoskr fixtures handed off
parity gate --target lua,rust,go,js --expect PASS — build/vs-truth/two-boot/two-pass all ok, 4 targets
go build + tests ✅ 7/7

Slice sizes: fib 54 defuns / 13.4 KB (was ~100 / 66 KB on community 41.2), hello 54, prolog 67, metaeval 548 (was ~568).

Merge dependencies: the per-port kernel/tarver-s41-refresh-20260711 branches (shen-lua#36, shen-rust#9, shen-go#18, ShenScript). Cross-lineage caveat: stage-1 host is still a community-41.2 shen-cl; a host built on the refreshed kernel is the right long-term stage-1 reference.

🤖 Generated with Claude Code

Lineage switch from community ShenOSKernel-41.2 to the S-series refresh
(canonical mirror pyrex41/shen-s41.1, tag s41.2-pristine-20260711).

The refreshed kernel has no shen.initialise: initialisation is toplevel
forms in declarations.kl (34 sets + arity table + external-symbols put +
build-lambda-table) and types.kl (161 declares). The shake now collects
those forms, seeds reachability from them, and synthesises a
(defun shen.initialise () ...) so the stage-2 builder contract is
unchanged. Eval-free programs blank the *macros* registration, drop the
declares, and replace the eval-kl-at-boot build-lambda-table call with a
literal (set shen.*lambdatable* ...) of deterministic eta-wrappers
restricted to the footprint.

Green: stage-1 shake on shen-cl host; lua target end-to-end on
fib/hello/prolog/parity fixtures (fib: 54 defuns / 13.4 KB,
needs-eval=false, cannot-reach=eval); go build + 7 tests.
Red (port-side couplings, for the per-port migrations): shen-lua
eval-kl define-path calls community hook shen.set-lambda-form-entry
(metaeval); ShenScript native put/get are dict-typed and reject the
property vector (all slices).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pyrex41
pyrex41 marked this pull request as ready for review July 14, 2026 11:38
called-fns consults kernel-defun? (the defp property) while collecting
seeds from the kernel's toplevel init forms, but only build-call-graph
set the marks - a cache-hit shake seeded nothing from the init forms
and silently under-shook (metaeval emitted 306 defuns instead of 548;
lua's native fallbacks masked it, the rust boot caught it:
'undefined function: vector'). load-call-graph now marks each row head.
Cache-hit and cache-miss shakes are verified byte-identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pyrex41
pyrex41 merged commit af48240 into main Jul 14, 2026
6 checks passed
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