feat(php): use new FFI for Arboricx

This commit is contained in:
2026-05-11 09:18:47 -05:00
parent d7a7a8134c
commit d37d443021
8 changed files with 305 additions and 605 deletions

View File

@@ -63,7 +63,7 @@ Arboricx is the portable executable-object format used by tricu. The project now
| **tricu (self-hosted)** | `kernel_run_arboricx_typed.dag` | A self-hosting Arboricx parser/executor written in tricu itself. Used as a kernel inside the Zig host for maximum portability ("cool but useless" — ~3s for `append`) |
| **Zig** | `ext/zig/` | **Production host** — native bundle parser, WHNF reducer, C ABI (`libarboricx.so` / `.a`), CLI (`tricu-zig`), Python FFI support |
| **JavaScript (Node)** | `ext/js/` | Native bundle parser, manifest decoder, Merkle DAG verifier, Tree Calculus reducer, CLI runner |
| **PHP** | `ext/php/` | Tree Calculus reducer, codecs, kernel loader, CLI runner |
| **PHP** | `ext/php/` | FFI wrapper around `libarboricx.so`, CLI runner |
All hosts share the same bundle format and Merkle hashing scheme.
@@ -240,6 +240,8 @@ The kernel path is kept as a "cool but useless" fallback — the DAG is tiny (~3
| `packages.default` / `packages.tricu` | Haskell tricu package |
| `packages.tricu-zig` | Zig CLI + `libarboricx.a` + `libarboricx.so` + `arboricx.h` |
| `packages.tricu-zig-tests` | **Separate test target** — C ABI + native bundle + Python FFI tests |
| `packages.tricu-php` | PHP source + `libarboricx.so` + `tricu-php` wrapper script |
| `packages.tricu-php-tests` | **Separate test target** — PHP FFI tests against fixture bundles |
| `packages.tricu-container` | Docker image |
| `checks.default` / `checks.tricu` | Haskell test suite via Tasty/HUnit |
@@ -287,12 +289,9 @@ tricu/
│ │ │ ├── codecs.js
│ │ │ └── cli.js
│ │ └── test/
│ ├── php/ # PHP bundle loader + reducer
│ ├── php/ # PHP FFI host for libarboricx.so
│ │ ├── src/
│ │ │ ── functions.php
│ │ │ ├── codecs.php
│ │ │ ├── kernel.php
│ │ │ └── Tree/
│ │ │ ── ffi.php
│ │ └── run.php
│ └── zig/ # Zig production host
│ ├── build.zig