Symptom
test-files/test_util_format_with_options.ts is failing the parity gate
on every PR rebased onto current main (seen blocking #944, #947, #951,
#953, #956, #957, #958 — and now also #947 again after rebase). It has
been the sole entry in NEW FAILURES (not in known_failures.json) for
each of those runs since #952, after #958 cleared the
crypto.subtle.encrypt failure that was masking it.
Reproduction
cargo build --release -p perry-runtime -p perry-stdlib -p perry
PERRY_ALLOW_UNIMPLEMENTED=1 ./target/release/perry \
test-files/test_util_format_with_options.ts -o /tmp/p
node --experimental-strip-types test-files/test_util_format_with_options.ts
/tmp/p
node (expected)
perry (actual)
Diagnosis pointer
util.formatWithOptions was added in #948 (b384b942 feat(util): add util.formatWithOptions (v0.5.970)). The PR description says:
The JS stub ignores the inspect-options bag and delegates to the
existing util.format — full options-passthrough is a follow-up.
The delegation isn't happening at runtime: every call returns
undefined. The HIR/manifest gate is being lifted correctly (no
compile error, no R005), but the runtime stub either isn't routed or
returns the wrong thing.
Likely suspects:
- The
formatWithOptions stub in crates/perry-stdlib doesn't
actually invoke util.format (or returns before the call).
- The function is registered but the dispatch tag returns
undefined for the no-options-touching first-arg case.
test-files/fixtures/util_format_with_options/ may have additional
context if it exists.
Why fix this now
The parity gate's NEW-FAILURES check is exit 1 on a single uncategorized
new failure. With this regression undiagnosed, every PR maintainer has to
either admin-bypass or add the test to known_failures.json (which would
hide the real bug). Admin-bypass was already used to land #958 today.
Acceptance
Symptom
test-files/test_util_format_with_options.tsis failing the parity gateon every PR rebased onto current main (seen blocking #944, #947, #951,
#953, #956, #957, #958 — and now also #947 again after rebase). It has
been the sole entry in
NEW FAILURES (not in known_failures.json)foreach of those runs since #952, after #958 cleared the
crypto.subtle.encryptfailure that was masking it.Reproduction
node (expected)
perry (actual)
Diagnosis pointer
util.formatWithOptionswas added in #948 (b384b942 feat(util): add util.formatWithOptions (v0.5.970)). The PR description says:The delegation isn't happening at runtime: every call returns
undefined. The HIR/manifest gate is being lifted correctly (nocompile error, no
R005), but the runtime stub either isn't routed orreturns the wrong thing.
Likely suspects:
formatWithOptionsstub incrates/perry-stdlibdoesn'tactually invoke
util.format(or returns before the call).undefinedfor the no-options-touching first-arg case.test-files/fixtures/util_format_with_options/may have additionalcontext if it exists.
Why fix this now
The parity gate's NEW-FAILURES check is
exit 1on a single uncategorizednew failure. With this regression undiagnosed, every PR maintainer has to
either admin-bypass or add the test to
known_failures.json(which wouldhide the real bug). Admin-bypass was already used to land #958 today.
Acceptance
formatWithOptions({}, "Hello %s", "world")returns"Hello world"at runtime.formatWithOptions({ colors: false }, "x=%s y=%d", "k", 7)returns"x=k y=7".test_util_format_with_optionspasses the parity comparison againstnode --experimental-strip-types.test-parity/known_failures.json(i.e. the fix lands, not a skip).