Repository navigation
Merged
Conversation
…callbacks, and tools/ownflow_dump.php to run it on MIR stopped before InsertMemoryOps
…nside try, unresolved gotos and out-of-range break levels throw; add tests/flow fixtures with tools/ownflow_check.sh
… for InsertMemoryOps, classifyTemp arms for EmitLlvm); corpus IR byte-identical
…GEN), FFI-call drift row, ctx trimmed to what is read (moduleFns)
…t is a sentinel, not null (a nullable typed array is a cell natively and came back NaN-boxed)
…nd MANTICORE_OWNFLOW=1
…place: a typed array returned through array<K,V>|null came back NaN-boxed
…o, as the one-hop coalesce does: $n->type->element ?? X handed back a null object
…chain coalesce is fixed
…th out of the body, before each loop-leaving break/continue too, and an if/else never unplants such an exit box-back: the slot left the loop raw and var_dump($v) past it read a string pointer as a float
…local, or an erased conditional's arm, moves), a live representation mismatch fails the build with function, name and line, self-copies take no +1, the trace env is read once, and a forced round clears stale insertions
…body also stores to it: a break taken before the store left the element raw in a slot read as a cell
…the return took no +1 on moves the owned arm that ran and drops the rest by identity; the pass no longer guesses which erased returns the emitter retains
# Conflicts: # src/Compile/Mir/Passes/EmitLlvmExpr.php # src/Compile/Mir/Passes/EmitLlvmModule.php
…name-level rc track, the transfer veto and the element-share scan are deleted (container moves and buffer-only shares are decided in the pass)
…s a return takes no +1 on (Return_::ownArms), and a bare-array free function returns +1 on every path so its caller's local owns the result (erasedarr class)
… the other owned locals die at return, the taken arm stays readable by getReturn()
…turn convention and container moves
…ocal release ops had no emitter and are deleted
… static method and closure returns +1 (Ownership::returnRetain decides, the emitter executes), callers own erased results; container stores move a local only when it is dead, else the container takes its own +1
…in / returnBorrowsObj), not the deleted emitter copies
…-callable callees; a live container store takes its +1 on the read itself; a concrete array rebind of an erased-result local shares its release class
…kes the local a cell (if/else, loop, switch, try): the join typed unknown read a string as an array; an erased-array result boxed into that cell is owned
…retained through a probe-boxed copy: the tag retain was a no-op on a raw buffer, so $c[] = $f ? $r : [] freed $r's array with the container
…n its own family (the receiver's ancestors, interfaces and module descendants), not from every method of that name
…lass too (erasedbuf)
… &&, ||, and, or, ?:, ??, ??=) is a cell: expression joins read the one joinDisagrees predicate
…narrowing reconciles its local that way, and the alias store cloned an array payload and dropped the original on every call (php-cs-fixer Token::equals with an array $other)
…ic string offset as php does; 1M-operation leak-loop case over Ds arrays and SplFixedArray
…plit element bytes from the header, the failed-check arm no longer returns into the loop, and a receiver held in a property or a static property is read and written in place (refs #101)
…pend done in place while the buffer has room (refs #101)
…alize receives its array with the keys as serialized (an int key stays an int)
… order, corruption protocol, dump and serialization (refs #101)
…efined-function trap for array_slice / array_splice behind SplQueue); var_dump and print_r read a mangled __debugInfo key as a protected / private property, as php does
…O offsets, add(), frozen stack / queue modes, cursor that starts invalid, dump and serialization (refs #101)
…rty) is loaded once per loop too: its load takes the header TBAA tag (refs #101)
…run one typed loop per element kind (refs #101)
…ads and writes at a byte offset (refs #101)
…<Bar>` resolve like any class name, a specialization is built over the TypeDef rather than its carrier, `@return T` refines a compatible native hint, and `$o[$k]` on a bound receiver is typed like offsetGet()
…es at the array's width and reads back as the #[TypeDef] class (refs #101)
…p() a compile error (#106)
…compare equal as php does. Fixes #67
…its width: a #[TypeDef] by its repr and signedness, a plain scalar by its family (refs #101)
… it to stderr and answering "No errors found"
…lds the plain scalar
…-buffer lineage's v17 are different layouts
…its as an int, take a numeric string or float as an unsigned value, and order unsigned in min/max/compare (refs #101)
4 tasks
…on an ICU that has it, so a program that pulls in the IntlTimeZone functions links against ICU 72; on an older ICU getIanaID() is undefined, as in php
…macOS and glibc but still crashes on Alpine arm64 (musl), so #67 is not fixed
blacktrs
added a commit
that referenced
this pull request
Oct 7, 2026
…114) * Remove the Zend cold seed; docs follow the pinned-release bootstrap The compiler bootstraps from BOOTSTRAP_VERSION (#112), so the seed has no consumer left. Removed: bin/compile, tools/compile_files_mir.php, bin/build --seed/--auto-seed, gate.sh MC_ZEND_SEED, install.sh's Zend fallback, and the dead tools composer_data_smoke.sh, typecheck_scan.sh, split_ll.php, docker/iopoll/diag.sh, docker/symfony_probe.sh. selfhost_stability.sh rebuilds through the manifest path instead of Zend; composer.json drops the php requirement (the installer downloads the release or builds from the pin). Docs: every guide, README and design note audited against the tree — seed instructions removed or marked historical, ABI references point at MemoryAbi::VERSION (18), memory-abi.md gains the 64-byte descriptor (json_fn), the v14 BIGINT box and the v18 native buffer block, pass tables gain NarrowScalarGuards, ResolveMethodFcc, ResolveOverloads, SpillFreshBases and OwnershipFlow. * docs/design: ownership flow, native buffers and stage0 bootstrap notes Three shipped designs had no design note: per-program-point ownership (OwnershipFlow, #15/#104), the native fixed-width buffer runtime behind SplFixedArray and Manticore\Ds (#108), and the pinned-release bootstrap (#112/#114). Each is derived from the code it cites; AGENTS.md links the stage0 note.
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Real-world PHP ported to Manticore keeps its hot data in PHP arrays and in an array-backed
SplFixedArray: a cell per element, a hash or vector buffer under it,offsetGetdispatch on every read. There was no fixed-layout, statically typed container a program could ask for, and several SPL data structures were missing or quadratic.What changes for users
Native containers (
Manticore\Ds, superset — seedocs/ds.md)Int8/16/32/64Array,UInt8/16/32/64Array,Float32/64Array,BitArray, andByteBuffer(typed, endianness-aware reads and writes at a byte offset).push(),pop(),$a[] = $v; whole-arraysum(),min(),max(),equals()./** @var UInt16Array<TokenKind> */stores at 2 bytes and reads back as the#[TypeDef]class, with its methods. A binding the array cannot hold (wrong width or signedness) is a compile error.$a[$i],$a[$i] = $vand$a[] = $vcompile to an inline bounds check plus a load or store; a counted loop loads the buffer and its length once.SPL, with php parity (fuzzed against php's own classes)
SplFixedArrayon the native buffer.SplHeap,SplMinHeap,SplMaxHeap,SplPriorityQueue— new.SplDoublyLinkedList,SplQueue,SplStackrewritten: O(1)shift/dequeue, LIFO offsets,add(), frozen stack / queue modes.Compiler fixes found on the way
#[TypeDef]binding (short class names inFoo<Bar>resolve throughuse; specializations are built over the TypeDef;@return Trefines a compatible native hint;$o[$k]on a bound receiver is typed likeoffsetGet()).json_encodehonoursJsonSerializableand emits a backed enum's value;print_r/var_dumpshow object properties with php's visibility markers;__unserializereceives int keys;pack/unpackfloat codes; prelude code no longer traps onarray_slice/array_splice; several crashes on values held inmixed(ArrayAccess writes, enum cases, float??).analyzereports front-end errors instead of answering "No errors found".Measured (macOS arm64)
Int32Arrayheld in a propertyarray<int,int>: ~39 ms)Int32Arrayarray: 51 ms)Int32Array->sum(), 10M elementsgetUInt32on aByteBuffervsunpack('V', $s, $o)Tokens extends SplFixedArray), symfony corpus, peak RSSphp-cs-fixer output is byte-identical before and after.
Compatibility
bin/buildcarries it.Manticore\Dsis a superset with no php oracle; its cases carry hand-written expected output.Testing
macOS: AOT suite 1711 passed / 0 failed, known-bug repros 56 XFAIL / 0 XPASS, analyzer 22 / 0. Linux: this PR's CI.
Known gaps (tracked)
#[TypeDef]property makes anyvar_dump()a compile error (pre-existing).foreachover a typed array bound to a#[TypeDef]yields the plain scalar.==passes on macOS and glibc now but still crashes on Alpine arm64 (musl); its repro stays a known bug.IntMap/Vec<T>/ deque, polyfill publishing): Manticore\Ds, next parts: check hoisting, typed element reprs, growable and byte buffers, SPL family on the native buffer #101.Fixes #92
Fixes #39
Fixes #57
Fixes #93
Fixes #94
Fixes #95
Fixes #96
Fixes #98
Fixes #99
Refs #101