From dcb911ec5b6807addf0f307b259a840394521081 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 00:15:03 +0000 Subject: [PATCH 1/2] ci: describe the 8.6 legs as running the GA release Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxhC1D34vSRsQVcgd3HwS6 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0459e4..bb74a5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,8 @@ permissions: # runs on PHP 8.4, 8.5 and 8.6 in parallel. 8.4 and 8.5 resolve stable tags; 8.6 # resolves z-engine's master (branch-aliased 8.6.x-dev) until z-engine tags 8.6. The # 8.6 legs are set up exactly as z-engine's own CI sets up its 8.6 line (plain -# php-version '8.6', which setup-php serves pre-release builds for too) and, like -# there, they are required, not allowed to fail. +# php-version '8.6', the GA release) and, like there, they are required, not +# allowed to fail. jobs: tests: name: Tests (PHP ${{ matrix.php }}) From ca61f24107ae9fce28647e97edc4b5463e0e2c67 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 11:57:35 +0000 Subject: [PATCH 2/2] chore(deps): require the stable z-engine 8.6.0 release z-engine tagged 8.6.0, so the PHP 8.6 line no longer needs its 8.6.x-dev branch: the constraint becomes ~8.4.2 || ~8.5.0 || ~8.6.0, every minor resolves a stable tag, and the docs drop the root-level workaround a consumer on PHP 8.6 needed until now. The prefer-stable flag existed only to keep 8.4/8.5 on their tags while the dev constraint was present, and goes with it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxhC1D34vSRsQVcgd3HwS6 --- .claude/agents/code-reviewer.md | 10 +++------ .claude/agents/phpt-author.md | 2 +- .github/workflows/ci.yml | 7 +++---- CLAUDE.md | 36 +++++++++++---------------------- README.md | 13 ++---------- composer.json | 5 ++--- 6 files changed, 23 insertions(+), 50 deletions(-) diff --git a/.claude/agents/code-reviewer.md b/.claude/agents/code-reviewer.md index d70c34f..f32ec37 100644 --- a/.claude/agents/code-reviewer.md +++ b/.claude/agents/code-reviewer.md @@ -33,13 +33,9 @@ Review against the checklist below, in this order of severity. ## 2. Version pins (blocking) - `composer.json` must keep `"php": "^8.4"` and - `"lisachenko/z-engine": "~8.4.2 || ~8.5.0 || 8.6.x-dev"` — one z-engine line per - supported PHP minor, resolved by Composer against the running PHP: stable tags for 8.4 - and 8.5, the `8.6.x-dev` development line for 8.6 until z-engine tags it (then it - becomes `~8.6.0` and `"prefer-stable": true` is dropped in the same change). The root - `"prefer-stable": true` is what keeps 8.4/8.5 on their tags while the dev flag is - present; a diff that removes it before then, or adds `"minimum-stability": "dev"`, is - rejected. + `"lisachenko/z-engine": "~8.4.2 || ~8.5.0 || ~8.6.0"` — one stable z-engine line per + supported PHP minor, resolved by Composer against the running PHP. A diff that adds a + development constraint, `"minimum-stability": "dev"` or `"prefer-stable"` is rejected. - Any diff that widens either constraint beyond the minors z-engine has definitions for (`>=8.4`, a `^8.4` z-engine constraint that would span future lines), or bypasses `Core::init()`'s version guard, is rejected outright. Offsets into engine structures are diff --git a/.claude/agents/phpt-author.md b/.claude/agents/phpt-author.md index a06bb43..4525a58 100644 --- a/.claude/agents/phpt-author.md +++ b/.claude/agents/phpt-author.md @@ -56,7 +56,7 @@ array(1) { JIT rewrites the executor internals z-engine hooks. There is no `error_reporting` line any more: it existed only to hide a deprecation z-engine's development line raised (implicitly nullable parameters), and the stable releases this package requires - (`~8.4.2 || ~8.5.0`) raise none. Do not add one back — PHPUnit's `.phpt` runner forces + (`~8.4.2 || ~8.5.0 || ~8.6.0`) raise none. Do not add one back — PHPUnit's `.phpt` runner forces `display_errors=1`, so a diagnostic reaching your captured output is real information, not noise to suppress. - **An operator cannot throw into userland.** `__doOperation`/`__compare` run inside an FFI diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb74a5b..a69c681 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,10 +9,9 @@ on: permissions: contents: read -# z-engine tracks one PHP minor per release line; the "~8.4.2 || ~8.5.0 || 8.6.x-dev" -# constraint lets Composer resolve the line matching each runner's PHP, so the suite -# runs on PHP 8.4, 8.5 and 8.6 in parallel. 8.4 and 8.5 resolve stable tags; 8.6 -# resolves z-engine's master (branch-aliased 8.6.x-dev) until z-engine tags 8.6. The +# z-engine tracks one PHP minor per release line; the "~8.4.2 || ~8.5.0 || ~8.6.0" +# constraint lets Composer resolve the stable line matching each runner's PHP, so the +# suite runs on PHP 8.4, 8.5 and 8.6 in parallel. The # 8.6 legs are set up exactly as z-engine's own CI sets up its 8.6 line (plain # php-version '8.6', the GA release) and, like there, they are required, not # allowed to fail. diff --git a/CLAUDE.md b/CLAUDE.md index 824350a..cac946c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,12 +15,10 @@ structures (`zend_class_entry`, `zval`, `zend_object_handlers`) by byte offset, those offsets change on every PHP minor release. Running against the wrong minor does not throw a nice exception; it reads and writes the wrong memory. -That is why z-engine is required as **`~8.4.2 || ~8.5.0 || 8.6.x-dev`**: Composer -resolves the line matching the running PHP (`8.4.x` on PHP 8.4, `8.5.x` on PHP 8.5, -z-engine `master` — branch-aliased `8.6.x-dev` — on PHP 8.6). Each line declares its -own `~8.4.0`/`~8.5.0`/`~8.6.0` platform requirement, so only one line can ever satisfy -a given runtime. 8.4 and 8.5 are stable tags; 8.6 rides the development line until -z-engine tags it. `ZEngine\Core::init()` (called from `bootstrap.php`) enforces the +That is why z-engine is required as **`~8.4.2 || ~8.5.0 || ~8.6.0`**: Composer +resolves the stable release line matching the running PHP (`8.4.x` on PHP 8.4, `8.5.x` +on PHP 8.5, `8.6.x` on PHP 8.6). Each line declares its own `~8.4.0`/`~8.5.0`/`~8.6.0` +platform requirement, so only one line can ever satisfy a given runtime. `ZEngine\Core::init()` (called from `bootstrap.php`) enforces the exact match and aborts with a clear message. **Never "fix" an initialization failure by loosening the constraints past the minors z-engine has definitions for, skipping `Core::init()`, or defeating the guard.** If the environment's PHP does not satisfy @@ -48,8 +46,8 @@ The suite used to carry a third line, `error_reporting=E_ALL & ~E_DEPRECATED`, f exactly that reason: z-engine's development line declared implicitly nullable parameters (e.g. `ZEngine\Type\OpLine::__construct()`) and PHP reported the deprecation into every test's output. The stable releases now required -(`~8.4.2 || ~8.5.0`) declare those parameters `?Type`, the suite passes with -`error_reporting=E_ALL` forced on both minors, and the line has been removed. **Do +(`~8.4.2 || ~8.5.0 || ~8.6.0`) declare those parameters `?Type`, the suite passes with +`error_reporting=E_ALL` forced on every minor, and the line has been removed. **Do not add it back to silence a new diagnostic** — a deprecation appearing in the captured output is a signal about a dependency or about this library, and hiding it only moves the failure somewhere harder to find. @@ -331,24 +329,14 @@ stable under `composer cs:fix`. ## Dependency policy -- `lisachenko/z-engine` is required as **`~8.4.2 || ~8.5.0 || 8.6.x-dev`** — one line - per supported PHP minor, resolved by Composer to match the running PHP. 8.4 and 8.5 - are **stable** release lines; the tilde is deliberate: it admits patch releases +- `lisachenko/z-engine` is required as **`~8.4.2 || ~8.5.0 || ~8.6.0`** — one + **stable** release line per supported PHP minor, resolved by Composer to match the + running PHP. The tilde is deliberate: it admits patch releases within a line (`8.4.3`, `8.5.1`) but never the next minor line, which would be built for a PHP this package does not claim to support. -- 8.6 rides z-engine's **development line**, `8.6.x-dev` (`master`, branch-aliased), - because z-engine has not tagged 8.6 yet. When it does, replace `8.6.x-dev` with the - tag's tilde constraint (`~8.6.0`) **and** drop `"prefer-stable"` in a single change. -- An explicit dev constraint carries its own root stability flag, so this package's - own installs (and CI) resolve `master` on PHP 8.6 without `"minimum-stability": - "dev"`. That flag applies to the whole package, though, so it would also admit the - `8.4`/`8.5` development branches on those minors — which is why the root carries - `"prefer-stable": true`: it keeps PHP 8.4 and 8.5 on their stable tags. Do not add - `"minimum-stability": "dev"`. -- **Stability flags do not propagate to consumers.** Until the 8.6 tag exists, a - project on PHP 8.6 must itself require `lisachenko/z-engine:8.6.x-dev` at its root - (or set `"minimum-stability": "dev"` with `"prefer-stable": true`). Consumers on 8.4 - and 8.5 need nothing extra. +- Nothing in `require` is a development branch, so the root carries neither + `"minimum-stability": "dev"` nor `"prefer-stable"`, and consumers need no + stability configuration on any supported minor. Do not add either. - PHP stays at `^8.4`, in lockstep with the set of z-engine lines this package tracks: a new PHP minor is added here only together with the z-engine line built for it, and never one without the other. diff --git a/README.md b/README.md index 39d4dda..5dd0e4a 100644 --- a/README.md +++ b/README.md @@ -187,8 +187,7 @@ The maths is plain PHP — or plain BLAS, if you asked for it. The magic is only - **PHP `^8.4`** — 8.4, 8.5 and 8.6 are supported in parallel. Z-Engine reads engine structures by byte offset and those offsets change on every PHP minor release, so each minor rides its own Z-Engine line; `Core::init()` refuses to boot on a mismatch rather than corrupting memory. - **`ext-ffi` enabled**, with `ffi.enable=1` for CLI usage. - **x64, non-thread-safe (NTS)** build — the same platform limitations as [Z-Engine](https://github.com/lisachenko/z-engine#requirements--support-matrix). -- The **matching Z-Engine minor release line**. Composer resolves it for you from the `~8.4.2 || ~8.5.0 || 8.6.x-dev` constraint; mixing a Z-Engine built for another minor is not a configuration choice, it is undefined behaviour. -- **On PHP 8.6 only:** Z-Engine has no stable 8.6 tag yet, so 8.6 rides its `8.6.x-dev` development line, and your project must allow that line at its root (see [Installation](#installation)). +- The **matching Z-Engine minor release line**. Composer resolves it for you from the `~8.4.2 || ~8.5.0 || ~8.6.0` constraint; mixing a Z-Engine built for another minor is not a configuration choice, it is undefined behaviour. ## Installation @@ -196,15 +195,7 @@ The maths is plain PHP — or plain BLAS, if you asked for it. The magic is only composer require lisachenko/native-php-matrix:dev-master ``` -This package requires Z-Engine as `~8.4.2 || ~8.5.0 || 8.6.x-dev` — z-engine minors track PHP minors and are not interchangeable, so Composer resolves the line matching your PHP automatically (`8.4.x` on PHP 8.4, `8.5.x` on PHP 8.5, `8.6.x-dev` on PHP 8.6). The 8.4 and 8.5 lines are **stable tags**, so no `minimum-stability` tweak is needed for them. - -**On PHP 8.6**, Z-Engine is still a development branch until it tags 8.6, and Composer only honours stability flags written in *your* root `composer.json` — not the ones a dependency declares. Require the line explicitly alongside this package: - -```bash -composer require lisachenko/native-php-matrix:dev-master lisachenko/z-engine:8.6.x-dev -``` - -(or set `"minimum-stability": "dev"` with `"prefer-stable": true` in your project). Once Z-Engine tags 8.6, this package tightens its constraint to that tag and the extra requirement can be dropped. +This package requires Z-Engine as `~8.4.2 || ~8.5.0 || ~8.6.0` — z-engine minors track PHP minors and are not interchangeable, so Composer resolves the line matching your PHP automatically (`8.4.x` on PHP 8.4, `8.5.x` on PHP 8.5, `8.6.x` on PHP 8.6). All three are **stable tags**, so no `minimum-stability` tweak is needed. native-php-matrix itself is not tagged yet, which is why the command above asks for `dev-master`; that one dev constraint is explicit, so Composer accepts it without a root stability change. Once a native-php-matrix release is tagged, this collapses to a plain `composer require lisachenko/native-php-matrix`. diff --git a/composer.json b/composer.json index 252cd95..17ef95d 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require": { "php": "^8.4", "ext-ffi": "*", - "lisachenko/z-engine": "~8.4.2 || ~8.5.0 || 8.6.x-dev" + "lisachenko/z-engine": "~8.4.2 || ~8.5.0 || ~8.6.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.75", @@ -53,6 +53,5 @@ }, "config": { "sort-packages": true - }, - "prefer-stable": true + } }