Skip to content

app-patterns: object_deep_clone and promise_all_chains fail only under the auto-optimize path; blocks the public baseline #7475

Description

@proggeramlug

Two benchmarks/app-patterns kernels fail only when the auto-optimize path is active — i.e. exactly how the benchmark harness invokes perry. They pass with PERRY_NO_AUTO_OPTIMIZE=1. This is the remaining blocker on regenerating the public benchmark artifact: run_public_baseline.sh now completes all four legs and fails at the end with "app-pattern component is incomplete or has a correctness failure".

Repro

PERRY_RUNTIME_DIR=$PWD/target/release ./target/release/perry \
  benchmarks/app-patterns/kernels/object_deep_clone.ts -o /tmp/k && /tmp/k
kernel PERRY_NO_AUTO_OPTIMIZE=1 auto-optimize (default)
object_deep_clone checksum: 1249975000 TypeError: next is not a function
promise_all_chains Uncaught (in promise) 0 TypeError: value is not a function

With auto-optimize off, object_deep_clone's checksum matches node and bun exactly (all three print 1249975000), so the non-auto-opt result is correct and the auto-opt one is wrong.

Not a regression

The pre-today parent 0402a05af fails both the same way under auto-optimize:

object_deep_clone   → TypeError: value is not a function
promise_all_chains  → Uncaught (in promise) 0

So this predates today's merges.

Why the error text matters

TypeError: value is not a function is the signature CLAUDE.md names for the GC rooting family — "surfacing cycles later as TypeError: value is not a function". That both kernels produce it (and that the message differs between the auto-opt and non-auto-opt builds of the same source) points at the feature-stripped runtime the auto-optimize path builds, rather than at the kernels.

Worth checking first: whether the auto-opt runtime is built with a feature set that changes GC behaviour, and whether the .a it links is the one being tested. The auto-opt path builds its own target/perry-auto-*/release/libperry_runtime.a and links that over PERRY_RUNTIME_DIR, which also silently defeats A/B testing of any runtime-side patch — that cost me three invalid experiments on #7472 before I noticed.

promise_all_chains has a second, separate failure

It fails under both configurations, differently: Uncaught (in promise) 0 without auto-opt, TypeError: value is not a function with. The former looks like a distinct promise-rejection bug rather than the GC signature, so this kernel probably has two problems.

Impact

The public benchmark artifact cannot be published while any app-pattern kernel is a RUNTIME FAIL — the gate is correct to refuse. Everything else in the sweep now completes: suite, polyglot, and JSON polyglot all pass, the last of those unblocked by #7473.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions