Fix root cause: parse-int in primitives table handles 2-arg form

The CSSX colour resolution failure was NOT a JIT compiler bug.
CALL_PRIM looks up primitives table (not env), and parse-int in
the primitives table only handled 1-arg calls. The 2-arg form
(parse-int "699" nil) returned Nil, causing cssx-resolve's colour
branch to fail its and-condition.

Fix: update Sx_primitives.register "parse-int" with same 2-arg
handling as the env binding. Remove the vm-reset-fn workaround.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 17:02:14 +00:00
parent b1de591e9e
commit 9ff913c312
2 changed files with 4 additions and 11 deletions

View File

@@ -439,16 +439,6 @@ class OcamlBridge:
skipped += 1
_logger.warning("OCaml load skipped %s: %s",
filepath, e)
# JIT workaround: reset functions with known compilation bugs.
# cssx-resolve has a complex cond that the JIT miscompiles
# (colour branch skipped even when conditions are true).
# Resetting forces CEK interpretation.
try:
await self._send('(vm-reset-fn "cssx-resolve")')
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: