Add sibling sublist parser tests + reset JIT sx-parse

Tests: parse "(a (b) (c))" must produce 3 siblings, not nested.
Catches JIT compilation bug where closing parens cause sibling
lists to become children.

Reset sx-parse to CEK on the OCaml kernel — the JIT-compiled
version of sx-parse's complex letrec produces wrong bytecode.
CEK interpretation works correctly (tests pass on all platforms).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 19:17:05 +00:00
parent 890c472893
commit 96f50b9dfa
2 changed files with 23 additions and 0 deletions

View File

@@ -440,6 +440,16 @@ class OcamlBridge:
_logger.warning("OCaml load skipped %s: %s",
filepath, e)
# JIT workaround: sx-parse has a complex letrec (20 mutually
# recursive functions) that the JIT compiles incorrectly —
# closing parens cause siblings to become children.
# CEK-interpreted sx-parse works correctly.
try:
await self._send('(vm-reset-fn "sx-parse")')
await self._read_until_ok(ctx=None)
except OcamlBridgeError:
pass
# SSR overrides: effect is a no-op on the server (prevents
# reactive loops during island SSR — effects are DOM side-effects)
try: