php: run a first conformance program on 5.6, 7.4 and 8.4 (step 2 of #64) #727
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#727
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Step 2 of #64 (backend: PHP). Step 1 (#702, PR #707) landed
docs/design/PHP.md; its section 6 names this as slice 1 of the implementation: the smallest slice that runs a real program under PHP 5.6, 7.4 and 8.4. It is the sibling of #678 (slice 1 of the JavaScript back end), whose pieces it copies where the IR, not the host, decides:compiler/src/backend/javascript/,runtime/javascript/,tools/conformance.sh --js,tests/conformance/js.allow, the jobconformance-js,.forgejo/actions/node.Source
docs/design/PHP.mdsection 1 (layout, target, shape of the output, CI), section 2.1 to 2.3, 2.5 and 2.7 (control flow withgoto, functions, integers, text, panics and guards), section 6 row 1 and "The first slice, precisely enough to file it", section 7 (the statements slice 1 must pin).docs/design/JAVASCRIPT-AND-PHP.mdsections 2a (theInthelpers), 2b (capability table), 2d (floor 5.6, fallback 7.4; decided in #62).What
php: run a first conformance program on 5.6, 7.4 and 8.4. Add
Architecture.Phptostd/coreandTargetArchitecture.Phptoproject/target.trb(the architectures ofLinuxbecome[.X64, .Arm64, .Php];everyTarget(),targetNamed, the tables ofdocs/tooling/torb-build.md), so thatlinux-phpis aBuildTarget. Createcompiler/src/backend/php/{emit,body,type,natives,writer}.trbandruntime/php/{core,int64}.php. Emit the constructs of the slice-1 row with onegotolabel per block:Integer(8 to 64 bits exceptUInt64),Boolean,Void, records and tuples,Constant,Move,Copy,Branch,Jump,Return,Panic,TextConcat,PrintParts,ExitWithCode; the text of section 2.5; the startup guards and hooks of section 2.7; the stack counter of section 1.4 for functions in a recursive cycle. Maketorb build,torb runandtorb checkaccept the target without--emit-c. Addtests/conformance/php_first.trbwith its.expected,.stderrand.exitfiles,tests/conformance/php.allow,tools/conformance.sh --php(interpreters fromCONFORMANCE_PHP), the action.forgejo/actions/php(pinned versions and SHA-256, commandsphp5.6,php7.4,php8.4) and a jobconformance-phpingates.yml.Decided by the loop
Coreandstandard, or official images by digest) is the implementer's to settle by trying in forge CI, as section 1.4 says; the requirement is a pinned version, a checked checksum andphp -d memory_limit=... file.php. Reasoning: a technical choice with no outward effect (recommendation test); a build needs no account or cost.runtime/php/core.phpand in section 7.Files
compiler/src/backend/php/{emit,body,type,natives,writer}.trb;compiler/src/project/target.trb,compiler/src/cli/(declaration, build, run, check).std/core(Architecture.Php).runtime/php/{core,int64}.php.tests/conformance/php_first.trband its expected files,tests/conformance/php.allow,tools/conformance.sh..forgejo/actions/php,.forgejo/workflows/gates.yml(jobconformance-php).docs/tooling/torb-build.md,docs/design/PHP.md(row 1 marked done, a "What slice 1 left out" paragraph, section 7 figures); docs regenerated astorb docsrequires.Tests
php_first.trbcovers integers of every width with an overflow that panics, a zero divisor, the smallest value divided by-1, functions and recursion, a struct,printof text with numeric-looking strings compared, and a deep recursion that panics at the stack limit.-d mbstring.func_overload=...where the interpreter has it, and with a forgedPHP_INT_SIZEthrough a test harness.php.allow.Acceptance criteria
torb build --target linux-phpbuildsphp_first.trbwithout--emit-cand the output runs on 5.6.40, 7.4.33 and the newest 8.4 patch release with the same.expected,.stderrand.exitfiles as the C, VM and JavaScript legsMIN / -1and stack-limit cases ofphp_first.trbexit 101 with the message of the other legs; the guards refuse a forgedPHP_INT_SIZEand a forged byte orderphp.allowholdsphp_firstand every existing program that uses only slice-1 constructs; programs left off are not listed as failures<?php, with no closing tag, no namespace and nodeclare(strict_types=1).forgejo/actions/phppins each version and checks its SHA-256; the jobconformance-phprunstools/conformance.sh --phpin forge CIdocs/design/PHP.mdmarked done;torb format --checkandtorb docs checkgreentools/check-commits.shclean;sh tools/gates.sh aand theconformance-phpjob green in forge CI (CI only, no local bootstrap or gates)Seed
Touches it by name: a new
Architecturecase and a new target that the build looks up. Expect two commits asdocs/design/PHP.mdsection 6 says: the case ofArchitectureand the target first, the back end after; confirm withtools/check-commits.sh. No syntax change, no new native, no new std name looked up by string. The seed refresh itself stays Torben's.Size
One PR, two Conventional Commits, as #678 was. If a review cannot hold it, the implementer cuts the CI action and
tools/conformance.sh --phpwith the job into the second commit's follow-up inside this issue; nothing larger is carved out here. What remains is slices 2 to 8 of the record (steps 3 to 9 of #64).Out of scope
Everything in the rows of slices 2 to 8 of section 6 (variants, switch, arrays, closures, cells, lazy, witnesses, objects, counts,
UInt64, the manifest walk, floats andlibm, tasks, limits,.nophpmarkers,torb test), a minifier, the Composer package (#66), the capability table (#65, closed).Dependencies
Part of #64 (epic; do not close it).
[loop:torbscript] refine: meets the definition of ready (goal, testable criteria, design reference into PHP.md and JAVASCRIPT-AND-PHP.md, seed impact stated, one PR in two commits). No owner question: the open items of PHP.md section 8 do not block slice 1 (see "Decided by the loop").
next: implementation of #727
[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-13T07:00:00Z
[loop:torbscript] release implement: worker timed out after 6 h with no report; PR #730 exists (head
bd928fdc) with a red 'commit messages' check (type 'style' is not allowed). next: fix round on the same branch (reword/squash the style commit) when a worker slot is free[loop:torbscript] claim review by session:loop-torbscript-20261113 until 2026-11-13T10:42:00Z
[loop:torbscript] release review: fix worker hit the anthropic:notahumanmate weekly limit (reset 2026-11-15T20:00Z) without a report; it pushed
36684a6to PR #730 first ('commit messages' no longer red, format --check on body.trb still to confirm). next: fix round on the same branch when a worker slot on another profile is free