FA-90078 / Bytecode virtual machines / Member archive
Upvalues: each closure gets a private copy of a captured local · case 03
After the scope closes, writes through one closure are invisible to its sibling.
Case contract
A register/stack VM with open and closed upvalues. ["local", v] pushes a slot; ["set", s, v] and ["get", s] access slots; ["closure", id, [slots]] captures slots, reusing the existing open upvalue for a slot so closures share variables; ["uset"/"uget", id, k, (v)] access the k-th upvalue, going to the stack slot while open and to the upvalue's own cell once closed; ["close", level] closes every open upvalue whose slot >= level (copying the slot value) and truncates the stack to level. Accessing a vanished slot appends "dangling-slot" and stops.
Why this case matters
Closure capture and upvalue closing are subtle lifetime transitions in register-based VMs.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| closing a scope keeps closures linked | [8, 8, 8] | [8, 8, 0] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗