Skip to content

repsel: PERRY_PTR_SHAPE_LOCALS=0 breaks test_gap_repsel_ptr_shape_locals (TypeError, exit 1) with no GC involved — the Phase 3b kill switch does not disable Phase 5a #6984

Description

@proggeramlug

Pre-existing on main; surfaced while running scripts/gc_repsel_matrix.sh --arms all for #6950. No GC is involved — the failing cell reports cycles=0 moved=0.

Repro

$ PERRY_PTR_SHAPE_LOCALS=0 perry test-files/test_gap_repsel_ptr_shape_locals.ts -o psoff
$ ./psoff
...
TypeError: Cannot read properties of undefined (reading 'area')
    at <anonymous>
$ echo $?
1

Diff against the Node oracle — the run dies just before the Phase 5a block:

18a19,22
> p5a-iface:3750:3:12
> p5a-named:42:21
> p5a-inherit:10:20:5:2:3
> p5a-collide:2:102:1102:56375:1152

Everything up to line 18 matches. With PERRY_PTR_SHAPE_LOCALS unset (the default) the whole file passes.

What it means

PERRY_PTR_SHAPE_LOCALS=0 is the documented A/B kill switch for repsel Phase 3b (Ptr<Shape> proven object locals, #6911). It is supposed to fall back to the boxed lowering and produce identical output — that is the entire point of the rep_ptr_shape_off matrix arm. Instead the fallback path produces undefined where an object is expected.

The four missing lines are the Phase 5a assertions (Ptr<Shape> proven this in methods) that #6925 appended to this file. So the most likely reading is that Phase 5a's lowering does not honour the Phase 3b kill switch: with the switch off, the this proof is still applied (or the fallback for it is missing) and the receiver comes out undefined.

Why it was never seen

Two independent reasons, both from #6925:

  1. It shipped test-files/test_gap_repsel_proven_this_frozen.ts without registering it in test-parity/gc_repsel_corpus.txt, so gc_repsel_matrix.sh --arms all aborted at the UNREGISTERED gate before evaluating a single cell. (Fixed in fix(gc): a compiled program can now actually reach an evacuating minor (#6950) #6977.)
  2. rep_ptr_shape_off is not in the PR arm subset, so no per-PR run covers it.

The matrix run in #6977 is the first --arms all that started since 1a533a3a8, and this is the one cell that was red before any of that PR's changes took effect: baseline summary: PASS=29 UNVER=350 XFAIL=0 FAIL=1, and this is the 1.

Related: #6911, #6925, #6950, #6977.

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