Repository navigation
Description
Summary
The py runtime's .isc parser (origin/main 0.2.x rewrite) diverges from ruby/ts/rs on the parse accept/reject boundary in BOTH directions — it accepts constructs the other three reject, and rejects constructs the other three accept. Found by the WO20 differential fuzz campaign (#284): ~130 of 1600 cases across these families.
A. py accepts what ruby/ts/rs reject (~88 cases)
- Nested
parallelinsidesequence— the docs/parity pinned negative probe (rejected 4/4 on the audited trees):
system "T:fz-em7:1" {
stage main {
sequence {
sub "a" "b"
parallel {
sub "c" "d"
}
}
}
}
py: accepts (and executes ab->bb); ruby/ts/rs: parse-reject.
-
Unknown/misplaced keywords and malformed escapes in rule position: ruby rejects with "expected one of ['n','r','t','"','\','u'...]" (escape grammar) or "expected 'sequence'/'parallel'/'run'/'before'/'after'..." (keyword position) — py accepts and continues. 30 of the 88 cases carry no WF-1 token at all; they are pure grammar-strictness drift.
-
rulesetinsidemetadata { }: py rejects, ruby/ts/rs accept — py is the strict one here, but note the other three ACCEPTING a ruleset inside metadata is itself suspect (three-way laxness vs py).
B. py rejects what ruby/ts/rs accept (~43 cases)
- Zero-width primitives in compound
fromexpressions:
system "T:350509:1" {
stage main {
sequence {
sub {
from word_boundary + capture(some("z")) + word_boundary
to "W" + ref(1)
not_before "j"
not_after "k"
}
}
}
}
py: parse-reject UnsupportedConstruct: primitive word_boundary; ruby/ts/rs: parse-accept (then fail at execution with named logic errors — its own parse/exec boundary question, see docs/parity G-rows).
run stage.<x>recursion: py rejects with a NAMEDUnsupportedConstruct: cyclic run stage.main(the only runtime that guards it); ruby/ts/rs crash — split into the dedicated self-run divergence issue.
Behavior matrix (representatives)
| case | ruby | ts | py | rs |
|---|---|---|---|---|
| nested par-in-seq | reject | reject | accept | reject |
| ruleset in metadata | accept | accept | reject | accept |
| unknown keyword in item position | reject | reject | accept | reject |
| malformed escape in rule string | reject | reject | accept (or crash, separate issue) | reject |
| zero-width prim in from expr | accept | accept | reject (UnsupportedConstruct) | accept |
Classification
Divergence, py side. The parse boundary (what is ISC and what is not) should be one grammar; today py's rewrite accepts a different language than the other three in both directions. Canonical reference: the ruby concern grammar / vendored isc.parg (docs/parity audit method), with the pinned negative probe (nested blocks rejected 4/4 at audit time).
Related py-side issues: escape crash (#44), parse hang (#43).
Activity
ronaldtse commentedon Nov 21, 2026
Fix state: py leg in review — interscript/interscript-py#46
Re-probed every family against fresh origin/main trees of all four runtimes today (2026-11-21) before writing any code. Correction to the earlier "re-verified closed" claim that circulated for this issue: py origin/main was still divergent on every family below — the grammar-sync work that was believed to have closed them had not landed in the py repo (the claimed regression pins, e.g.
tests/test_isc_parser.py::TestParseBoundaryFuzzFamilies, do not exist on any py branch). The only post-campaign py fixes that did land are #43 (truncated-map termination) and #44 (named\uescape errors) via #45.Aligned in interscript/interscript-py#46 (each family as a class, pinned in
tests/test_isc.py; probes through the campaign drivers land in the same bucket as ruby/ts/rs after the fix):parallelinsidesequence"a\q")fromrulesetinsidemetadataAlso pinned in #46: the maps#294 self-run repro (py's cycle guard predates the campaign; the pin joins the existing mutual-cycle test).
Corpus safety: full 457-map parse sweep on a pristine py origin/main worktree vs the fix branch — identical failure sets (419 OK / 38 pre-existing failures, zero diff); full suite 110 passed.
Observed, not touched (owner-facing): py 0.2.x has no WF-1
use/rulesetexpansion at all (document-levelrulesetblocks reject "Unexpected keyword: ruleset"; stage/block-leveluselines are skipped) — a larger gap than the filed families, kept at prior behavior in #46. The 38 pre-existing corpus failures (funcall stage items,%-escape note text) are unchanged.The issue closes when #46 merges (py is the only divergent runtime, so that merge completes the fix set).
fix(isc): align the parse boundary with the reference grammar; free-t…
ronaldtse commentedon Nov 21, 2026
Complete — py#46 merged, py was the only divergent runtime. Fixed as classes against the vendored grammar: nested-block-in-rule absorption (the in-loop 'Parslet drops tokens' parity claim was false — ruby rejects), unknown keywords now named errors, malformed escapes rejected at position, zero-width-from deferred to the named unsupported-op path, ruleset-in-metadata aligned to the trio's reject (issue premise inverted — py was the lax one), plus a NEW class found while probing: isc_source not anchored at end-of-input (silent truncation). Pins per family; suite 110/0; corpus sweep zero-diff.
ronaldtse commentedon Nov 23, 2026
parity-G7 contract record: duplicate ruleset declaration is a load error — all four runtimes now agree
Closing the loop on the G7 case class from the WO20 fuzz campaign (classifier:
scripts/fuzz/classify.mjsduplicateRuleset—ruleset <ident>declared more than once in one document). The contract was ruled in the WO18 G7 round; this comment records the ruling and its final four-runtime state, probed today (2026-11-23) on fresh origin/main clones of all four runtimes with the parity probesdocs/parity/probes/maps/tst-rsdupdef.isc(P6c:useinside a sequence block) andtst-rsdup2.isc(P6d: stage-leveluse).Contract
A
rulesetdeclared more than once in a document is a named load error — not keep-first, not last-wins, not merge.Rationale (consistency with the nearest analogous case, never invented semantics):
usecycles a load-time named error. A duplicate declaration is the same ruleset-table integrity violation one step milder; the parity audit (maps#275, G7 section) proposed extending it.{r["name"]: r["body"]}table overwrite) makes expansion order-dependent — the P6c probe executed content from both definitions under the old rs merge (1yz).Four-runtime state (measured today, fresh mains)
Interscript::MapLogicError: ruleset "a" declared more than once in …lib/interscript/isc/document_builder.rb(ruby#854)ISC load error: ruleset "a" declared more than once in T:tst-rsdupdef:1src/isc/expand.ts(ts#138)map logic error: ruleset "a" declared more than once in …src/builder.rs(rs#19)xz→x3on P6c/P6d) — the 0.2.x parser rewrite lost the 0.1.0 check that the WO18 round cites as canonUnsupportedConstruct: ruleset "a" declared more than once in T:tst-rsdupdef:1(py's named-load-error family, same class as its cycle/unknown-ruleset rejections)src/interscript/isc.py, dep documents checked in_owner_rulesetsRegression pins: ruby
spec/interscript/isc/wf1_semantics_spec.rb, tstest/isc/wf1.test.ts, rstests/wf1.rs::duplicate_ruleset_is_a_load_error, pytests/test_wf1.py::test_duplicate_ruleset_declaration_is_a_named_load_error(both block-useand stage-level-useforms).Scope notes
subrows inside a parallel block are a different, already-agreed case: last-wins, pinned in rstests/corpus/rs-parallel-tree.isc("duplicatefromkeys are LAST-WINS").docs/parity/README.md's G7 section describes the 2026-11-13 audit state ("only py rejects") — both halves are now stale: all four runtimes reject, and the divergent runtime of record today was py. The canonical line in that section (py's fail-loud) is confirmed as the contract.