Repository navigation
kernel: vendor upstream ShenOSKernel 43.1 at ec16a9f; keep the native typechecker on it - #99
Merged
Merged
Conversation
… checker) Replace the 23 klambda/*.kl files with the kernel built from unmodified Shen-Language/shen-sources ec16a9f, the merge of shen-sources#117. shen.by-hypothesis and shen.search-user-datatypes now dereference the checked term once per call through new -h predicates, and fail at once on an empty list. (version) is still "43.1". The archive is ShenOSKernel-43.1-ec16a9f.tar.gz from pyrex41/shen-sources release upstream-ec16a9f, sha256 060066a8f84d9a2f7d41cb3b37b986a8d4653279752b739b5063cd648d9baacd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- typecheck_native.lua: accept ec16a9f's shen.search-user-datatypes
fingerprint (483d69ab4d98d601). Its only change from the deref-hoisted
shape is an empty-list guard that returns false without dereferencing.
The hand port already fails on an empty list before any clause, counts
no inference there, and never copies on deref.
- prolog_compile.lua: compile (= (shen.lazyderef X B) T) as an arena
comparison. ec16a9f's translated shen.by-hypothesis tests
(= (shen.lazyderef Hyp B) ()) before calling shen.by-hypothesis-h, and
this was refused before ("goal call with <4 args: shen.lazyderef"),
which sent every typecheck to the KL typechecker.
- kernel_conformance_spec: the vendored kernel now has the hoisted shape.
Its driver closure adds shen.by-hypothesis-h, and eqterm fires there.
Co-Authored-By: Claude Opus 5.5 <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.
Vendors upstream Shen-Language/shen-sources
ec16a9f. That is the 43.1 release plus shen-sources#117:shen.by-hypothesisandshen.search-user-datatypesdereference the checked term once per call through new-hpredicates, and fail at once on an empty list. The PR then makes the native typechecker follow that kernel without falling back.(version)is still"43.1".Commits
klambda/*.klfiles, byte-identical toShenOSKernel-43.1-ec16a9f.tar.gz(https://github.com/pyrex41/shen-sources/releases/tag/upstream-ec16a9f, sha256060066a8f84d9a2f7d41cb3b37b986a8d4653279752b739b5063cd648d9baacd). The commit also updatesklambda/PROVENANCE.md,klambda/README.mdand the CHANGELOG.tests/is unchanged and identical to the archive.shen.search-user-datatypeshas a new fingerprint (483d69ab4d98d601).typecheck_native.luanow accepts it. The only change from the deref-hoist shape it already accepted is the empty-list guard. The hand port already fails on an empty list before any clause, counts no inference there (the-hclauses never match[]), and never copies on deref.shen.search-user-datatypes-hhas the same fingerprint as the hoist shape.shen.by-hypothesisnow starts with(if (= (shen.lazyderef Hyp B) ()) false ...). The translator refused it ("goal call with <4 args: shen.lazyderef").prolog_compile.luanow treats a(shen.lazyderef X B)of a term variable as an engine term in=, so the guard compiles to an arena comparison:LZD(x) == NIL. Plainshen.derefis deliberately not accepted there, because it is the identity in term position.kernel_conformance_specnow expects the vendored kernel's hoisted shape. The driver closure addsshen.by-hypothesis-h, and eqterm still fires inshen.by-hypothesis-h.Gates (local, LuaJIT 2.1.1785763465)
make test: 1797 pass, 0 fail across 29 specs. kernel_conformance_spec is 23/0.make certify: 154 / 0, with inference counts identical to main. Also 154 / 0 underSHEN_TYPECHECK_NATIVE=require.SHEN_TYPECHECK_NATIVE=require. No stderr contains a fallback notice.Speed (b-typed,
/usr/bin/time -l, one pair)As expected, this is flat. shen-lua's native engine never copies on deref, and #96 eqterm already removed the by-hypothesis materialisation. The kernel change matters here only for staying native on the upstream kernel.
🤖 Generated with Claude Code