You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Divergence: ruby miscompiles alias bodies of the form alias = maybe(...) — rule silently never fires (fuzz, 52 cases) #292
When a maybe(...) expression is the body of an alias, ruby miscompiles the alias so the rule never matches — silently. The same map transliterates correctly on ts, py, and rs.
Found by the WO20 differential fuzz campaign (#284): 52 of 1600 cases, all one root cause.
Minimal repro (10 lines)
system "T:fz-em5:1" {
aliases {
a_chain = maybe(any(["x", "y", "z"]) + any("1".."3"))
}
stage main {
sequence {
sub a_chain "R"
}
}
}
Input abc (the rule's from matches empty via maybe, so R inserts at every boundary):
runtime
output for abc
ruby (origin/main 4c47eb5)
abc — unchanged; the rule silently never fires
ts (origin/main b74cfda)
RaRbRcR
py (origin/main c6ae457)
RaRbRcR
rs (release 0.3.2)
RaRbRcR
Why this looks like a ruby-only miscompile
sub maybe("k") "R" directly in from: all four agree (RaRbRcR).
alias = maybe("k"), sub alias "R": all four agree.
alias = maybe(x + y) (maybe at the TOP LEVEL of an alias body): only ruby diverges — the maybe-ness is lost and the compiled rule never matches, with no error anywhere.
Same failure via chains: a1 = any(...); a2 = a1 + any("1".."3"); a3 = maybe(a2); sub a3 "R" → ruby abc, others RaRbRcR.
Classification
Divergence (silent wrong output, ruby side wrong per the majority + the direct-form agreement). Owner decision needed on whether maybe-at-alias-body-top is legal ISC; if legal, ruby's expansion is wrong; if illegal, all four should reject at parse — today three accept and execute it consistently, ruby silently drops the rule.
Filed here (maps) per the WO20 rule: cross-runtime divergences are filed in maps referencing all four runtimes.ruby evidence above; ts/py/rs behavior is the consistent reference.
Root cause (ruby only): the compiler wrapped a Maybe/Some/MaybeSome over a multi-atom alias body by appending the optionality suffix to the body's LAST atom instead of the whole body — maybe(any([x,y,z]) + any("1".."3")) built (?:x|y|z)[1-3]?, so alias = maybe(...) rules never matched, silently. ts/py/rs were always correct.
Fix: interscript/interscript-ruby#867 (fc75488), shipped in ruby v3.7.3 — the wrap condition was inverted; only a single-character String body is its own atomic unit. Regression-pinned by spec/interscript/isc/fuzz_findings_spec.rb + the alias-maybe fixture.
Re-verified on fresh origin/main trees today (2026-11-21), all four runtimes through the campaign's own drivers:
Both the issue's minimal repro and the chained-alias variant agree 4/4. The legality question the issue raised (whether maybe-at-alias-body-top is legal ISC) is settled by behavior: it is legal, all four execute it identically.
Activity
ronaldtse commentedon Nov 21, 2026
Verified closed — fix set complete
Root cause (ruby only): the compiler wrapped a
Maybe/Some/MaybeSomeover a multi-atom alias body by appending the optionality suffix to the body's LAST atom instead of the whole body —maybe(any([x,y,z]) + any("1".."3"))built(?:x|y|z)[1-3]?, soalias = maybe(...)rules never matched, silently. ts/py/rs were always correct.Fix: interscript/interscript-ruby#867 (fc75488), shipped in ruby v3.7.3 — the wrap condition was inverted; only a single-character String body is its own atomic unit. Regression-pinned by
spec/interscript/isc/fuzz_findings_spec.rb+ thealias-maybefixture.Re-verified on fresh origin/main trees today (2026-11-21), all four runtimes through the campaign's own drivers:
abc(direct repro, maybe at alias-body top)RaRbRcRRaRbRcRRaRbRcRRaRbRcRy(real match)RyRRyRRyRRyRabc(chain form: a1 = any(...); a2 = a1 + any; a3 = maybe(a2))RaRbRcRRaRbRcRRaRbRcRRaRbRcRBoth the issue's minimal repro and the chained-alias variant agree 4/4. The legality question the issue raised (whether maybe-at-alias-body-top is legal ISC) is settled by behavior: it is legal, all four execute it identically.
Closing as complete. Related open closeout: #294 (contract posted, ruby/ts legs in review), #293/#295 (py leg in review, interscript/interscript-py#46).