[PHP] Establish a reproducible PHPT conformance surface#740
Merged
brandonpayton merged 11 commits intoJul 10, 2026
Conversation
Phase B-1 matrix build status —
|
| Package | Arch | Status | Sha |
|---|---|---|---|
| libiconv | wasm32 | built | 0940adeb |
| libiconv | wasm64 | built | a3254e70 |
| libxml2 | wasm32 | built | f31b85aa |
| libxml2 | wasm64 | built | 2307f0d7 |
| php | wasm32 | built | 9da1b62c |
| rootfs | wasm32 | built | b79c2fb2 |
| shell | wasm32 | built | 6e925d8a |
| node-vfs | wasm32 | built | ead76749 |
Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.
6 tasks
Port the PHP-specific harness, browser VFS/page wiring, PHP 8.3.15 package recipe, libiconv dependency package, and support fixtures from source PR #2 as a scoped checkpoint. General platform fixes and current validation evidence follow in later commits.
Sort fork-bearing regions before allocating locals and rewriting sequences so identical inputs produce identical output bytes. Preserve a shared module’s leading dylink.0 section across Walrus emission, and cover both contracts with focused regressions.
Build PHP and its native dependencies from verified sources in isolated workdirs, pin clang to its adjacent wasm-ld, and use target-correct configure cache values. Marshal POSIX timer notifications through a fixed-width libc contract and suppress SIGEV_NONE wakeups consistently across libc, kernel, and host. Keep the PHP timeout hook’s later Batch 2 ABI dependency explicit.
Layer PHP artifacts and maintained fixtures over the canonical rootfs, and fingerprint every image input so stale browser test images rebuild automatically. Use packaged ps and pgrep, resolve canonical lazy executable URLs, preserve observable PHPT filesystem state, and remove static OpenSSL policy data from the kernel.
Align section environments, cleanup, expectation matching, extension probing, source discovery, and retry behavior with PHP’s runner where Kandelo supports them. Keep unsupported boundaries, BORK, WARN, XPASS, timeouts, and warned mismatches visible in reports and exit status, with focused harness coverage and historical evidence labeled as such.
3109baf to
9f2c7d6
Compare
This was referenced Jul 10, 2026
brandonpayton
added a commit
that referenced
this pull request
Jul 13, 2026
Rebuild PHP 8.3.15 and its dependencies through deterministic package recipes, add the canonical PHPT Node/browser harness and VFS assets, and keep verdict reporting and fork-instrumented output reproducible. Route the required __wasm_posix_vm_interrupt_after import from process workers to kernel workers on both browser and Node hosts. Validate fixed-width POSIX timer notification fields and suppress SIGEV_NONE wakeups. Advance ABI 26 to 27, bind the PHP package floor to 27, and regenerate the snapshot, host bindings, and libc header atomically. Source-PR: #740 Source-PR: #757
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.
Purpose
PHP's upstream PHPT suite is a high-value compatibility surface for Kandelo: failures exercise package builds, libc, syscalls, process state, signals, networking, VFS behavior, and Node/browser host parity through the normal platform path.
This PR establishes a reproducible PHP 8.3.15 package and PHPT test surface for Node and browser. It does not claim that the repaired branch has rerun or passed the full PHPT suite. Runtime fixes discovered through that surface remain separate Batch 2 constituents.
What this establishes
Review and landing repairs
The five source commits were replayed onto Batch 1 tip
5e011b6f49b1d8f8fa5ba34386934cfecd4e697e. The Vite conflict retained the currentdropWorkerEntryExports()behavior while adding the PHP test-page input. Six append-only review commits were then added:Deterministic fork instrumentation
dylink.0section after Walrus emission.dylink.0placement.Reproducible PHP package artifacts
wasm-ld, uses target-correct configure cache answers, and strengthens artifact guards.SIGEV_NONEwakeups consistently across libc, kernel, and host.Canonical browser test state
psandpgrepinstead of harness-local substitutes.Truthful PHPT verdicts
Full PHPT VFS capacity
Clean browser readiness
Landing boundary and recommendation
Recommendation: accept into the stacked Batch 2 aggregate only; do not land or publish this PR standalone.
The generated PHP programs deliberately import
env.__wasm_posix_vm_interrupt_after. Its host implementation arrives later in #757, so PHP execution on this constituent alone would fail at the known missing-import boundary.Batch 2 must also reconcile the two divergent ABI-16 lineages, bump
ABI_VERSIONto 17, regenerate all ABI artifacts, and raise PHP'skernel_abifloor to 17. The current ABI-16 consistency check below establishes only that this intermediate replay has no unrecorded structural drift; it is not the final Batch 2 ABI gate.Validation on the repaired replay
cargo test -p kandelo --target aarch64-apple-darwin --lib— 971 passed.cd host && npx vitest run— 120 files passed, 8 skipped; 899 tests passed, 2 expected failures, 26 skipped.cd host && npm run typecheck— passed.setjmp/longjmp.bash scripts/check-abi-version.sh— the intermediate ABI-16 snapshot, C header, and TypeScript bindings are current.bash build.shruns passed on the repaired tree.git diff --check, shell syntax checks, andrustfmtchecks for the modified fork-instrument files passed.cargo fmt --checkwas unavailable in the canonical dev shell and is not claimed.Reproducible PHP artifacts
Two complete PHP candidate builds produced exactly five outputs with byte-identical contents:
opcache.sob2445f62a55606ef77eaf9b6813d23e01162cfe2628ce5c4208aa11806f1cbbfphar.so1a274611837e988dd22304e1e2992d347798132bc751655fa11bf7673c62923ephp-fpm.wasm5cbf9e6fead2799aa429a0383ee88edbb313abc69242871c274f79d234c8c97aphp.wasm9bfb04598529dcc6aa6fca026d6bd2e6d755831b64e29534581fc6ee93e8c5cfzend_test.so760a079652ae8ba42521e7d62d9287d65cb203415c42ff327552b22fff55e30bNode 24 compiled all five outputs. Artifact inspection found resolved side-module imports, ABI 16 metadata, complete fork metadata, the expected later-Batch-2 timeout-hook import, and no legacy Asyncify, raw
setjmp/longjmp, native timer, forbidden SQLite/DNS, or producer-path residue.opcache.sobegins withdylink.0; Kandelo's parser reports:A wasm64 executable timer smoke test was attempted but could not link because the repository-declared Clang lacks wasm64 compiler-rt builtins. No wasm64 timer runtime result is claimed.
PHP test VFS and real browser readiness
.phptfiles, and exact byte matches for all five reviewed PHP artifacts.668115501a466fc2a9cb9c3ea13370fd2fc08907ba25a6c6cd8d3d986f7575ca.b2e8ece8f50c9867de56e757e700bad5d8c05975b2d2a0405a9895627d679752../run.sh browser --host 127.0.0.1 --port 5417 --strictPortcompleted browser preparation and started Vite./pages/php-test/reached exact statusReady; installedwindow.__runPhpScript; was cross-origin isolated withSharedArrayBuffer; fetched the kernel, PHP VFS, and favicon with HTTP 200; and had no Vite overlay, console error, page error, failed request, or HTTP failure. Screenshot:/tmp/php-740-browser-ready.pngin the landing environment.Historical PHPT evidence — not rerun here
These counts were imported from the pre-split source tree at
bc13ad8631a2. They are historical context only and are not validation of this repaired replay.The full Node and browser PHPT suites were not rerun.
scripts/run-libc-tests.sh, the POSIX suite, and the Sortix suite were also not run for this constituent; the full conformance and ABI-17 gate belongs on the exact Batch 2 aggregate after #757 and the remaining platform repairs land.Replay provenance
The original remote head was
3109baf285c151471b7be1264c9cdc10478d0871. Because #740 conflicted with the current stacked base, its five source commits were replayed rather than blindly retargeted. The repaired source branch ends at9f2c7d6ff7bab32fc230d4b069817accedec96d4and is updated only with an exact--force-with-leaseagainst that prior head.