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
Reliability: memory-safety CI — ASan/UBSan runtime build, valgrind on the smoke set, a PHPC_RUNTIME_ASSERT=1 mode that checks refcount/ownership invariants, and a written memory-model spec the assertions are derived from (lib/AOT/Linker.php, lib/JIT/Builtin/Refcount.php, docs/runtime-semantics.md) #36397
Foundation: · the recurring defect class · child of #36379
Why
AGENTS.md calls intermittent heap corruption "a recurring defect class" (7/10, 6/10, 3/5 pass rates for the same binary). Wave 1 added and then reverted a destructor path that "broke all user-script AOT compile", found refcounts that never drop in {main}, a GC that segfaulted at 2,000 objects, and an over-aligned __value__ that was UB under optimisation. There is no sanitizer build, no valgrind job, no runtime assertion mode, and no document stating the ownership rules (who addrefs, who delrefs, when a container is separated). Without a spec, every fix is a guess and every gate is a coin flip.
Deliverable
docs/runtime-semantics.md §Memory model: invariants for __ref__ (who owns a count), boxed temporaries, {main} vs function scope, container separation, string immortality, helper-unit boundaries, GC roots; each invariant numbered.
PHPC_RUNTIME_ASSERT=1 build mode: __ref__addref/delref/separate and the dtors check the numbered invariants (rc > 0 on delref, no delref of immortal, no write to a shared container) and abort with the invariant number and a PHP-level trace (Add $_GET superglobal support for VM web scripts #16).
Category
Foundation:· the recurring defect class · child of #36379Why
AGENTS.md calls intermittent heap corruption "a recurring defect class" (7/10, 6/10, 3/5 pass rates for the same binary). Wave 1 added and then reverted a destructor path that "broke all user-script AOT compile", found refcounts that never drop in
{main}, a GC that segfaulted at 2,000 objects, and an over-aligned__value__that was UB under optimisation. There is no sanitizer build, no valgrind job, no runtime assertion mode, and no document stating the ownership rules (who addrefs, who delrefs, when a container is separated). Without a spec, every fix is a guess and every gate is a coin flip.Deliverable
docs/runtime-semantics.md§Memory model: invariants for__ref__(who owns a count), boxed temporaries,{main}vs function scope, container separation, string immortality, helper-unit boundaries, GC roots; each invariant numbered.PHPC_RUNTIME_ASSERT=1build mode:__ref__addref/delref/separateand the dtors check the numbered invariants (rc > 0 on delref, no delref of immortal, no write to a shared container) and abort with the invariant number and a PHP-level trace (Add $_GET superglobal support for VM web scripts #16).--asanlink (Add $_GET superglobal support for VM web scripts #16) + runtime allocations poisoned on free; weekly workflow runsaot-smoke, the differential corpus (--repeat 3) and the Stdlib: pi, angle conversion, log/exp, and float checks #10 soak under ASan;valgrind --error-exitcode=1on the 9 smoke cases nightly.@differential-repeat: 10.Done when