Skip to content

chore: pin z-engine to the released 8.4 line - #13

Closed
lisachenko wants to merge 3 commits into
mainfrom
claude/pin-z-engine-8.4
Closed

chore: pin z-engine to the released 8.4 line#13
lisachenko wants to merge 3 commits into
mainfrom
claude/pin-z-engine-8.4

Conversation

@lisachenko

Copy link
Copy Markdown
Owner

Replaces dev-master || ^8.4 on lisachenko/z-engine with ^8.4 — completing the pin that PR #8 prepared (tracked in lisachenko/z-engine#95).

Why now: z-engine 8.4.0 is tagged and live on Packagist, and z-engine's master has moved to PHP 8.5 (lisachenko/z-engine#134) — the dev-master alternative would break this PHP 8.4 library on its next dependency update. The 8.4 line is maintained on z-engine's 8.4 branch.

Also removes minimum-stability: dev / prefer-stable: true: z-engine was the only dev-versioned constraint, so the overrides no longer cover anything.

Verified locally with PHP 8.4.19: composer validate --strict passes and composer update --dry-run resolves lisachenko/z-engine (8.4.0).

Outlook: this pins the library to the 8.4 line so a 1.x branch can later be forked for PHP 8.4 maintenance while master moves to the z-engine 8.5 dev dependency.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HRDZ2XsoVuB5uG4qXKL3ny


Generated by Claude Code

z-engine 8.4.0 is tagged and on Packagist, and its master now targets
PHP 8.5 - keeping the dev-master alternative would break this PHP 8.4
library on the next update. With the dev dependency gone, the
minimum-stability/prefer-stable overrides have nothing left to cover.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HRDZ2XsoVuB5uG4qXKL3ny
Comment thread composer.json Outdated
claude added 2 commits August 6, 2026 15:48
z-engine's owned-vs-borrowed construction split (a56d59d, part of the
8.4.0 release) replaced PersistentHashTable::create() with plain
construction - update all call sites. This is what broke CI once the
dependency resolved to the tag instead of the pre-refactor dev-master.

Also per review feedback: require ~8.4.0 instead of ^8.4 - z-engine
minors track PHP minors and are not interchangeable, so the constraint
mirrors php ~8.4.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HRDZ2XsoVuB5uG4qXKL3ny
The flat-memory soak grew ~450 bytes per attach/detach cycle (+2237912 over
5000, budget 65536) once the dependency resolved to z-engine 8.4.0.

z-engine's owned-vs-borrowed construction split (a56d59d) repurposed the
HashTable constructor: it no longer wraps an existing engine table, it CREATES
a new owned one, and borrowed views moved to HashTable::fromCData(). The new
constructor takes no arguments, so `new HashTable($dynamicProperties)` silently
ignored the pointer and minted a fresh table on every detach. That table was
registered in z-engine's tracked-block registry and never released, while the
object's own properties table - the one this code exists to free - kept its
reference and survived to request end. releaseReference() was dropping the
refcount of the throwaway table instead.

Bisected to get_object_vars() in the soak loop, which is what makes the engine
rebuild the properties table in the first place; every other mutation in that
loop was already flat.

soak.php 5000 goes from +2237912 to -1728 bytes. phpunit stays 39/39.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HRDZ2XsoVuB5uG4qXKL3ny

Copy link
Copy Markdown
Owner Author

Status: everything on this PR is done except the Reclaiming soak job, which is blocked on an upstream z-engine 8.4.0 regression — Core::pointerAtAddress() leaks ~116 B/call, fixed in lisachenko/z-engine#135. Once that merges to the 8.4 branch and 8.4.1 is tagged, this PR's ~8.4.0 constraint picks it up and the soak passes (verified locally: +9.2 MB FAIL → +32 KB PASS with the fix overlaid).

Also note: some earlier red checks here were the GitHub Actions incident (jobs died resolving actions before any step ran) — re-runs, not code changes, are the cure for those.


Generated by Claude Code

@lisachenko

Copy link
Copy Markdown
Owner Author

Rebase and allow both 8.4 and 8.5 PHP (^8.4) and both dev versions of z-engine 8.4.x-dev | 8.5.x-dev ( drop last commit on rebase if not needed )

Copy link
Copy Markdown
Owner Author

Rebased onto current main and every commit here is superseded, so I'm closing this PR instead of force-pushing an empty diff:

  • Composer constraints: main already has exactly what you asked for via chore: support PHP 8.4 and 8.5 in parallel (+ adapt to current z-engine hashtable API) #14"php": "^8.4" and "lisachenko/z-engine": "8.4.x-dev || 8.5.x-dev" (plus the CI matrix running both minors).
  • Code adaptation: the hashtable-construction call-site updates from this branch landed on main as cd938a2, covering the same Persister/Registry/PersistentStore sites.
  • Last commit (the detach leak fix): dropped, per your instruction — and it's not just unneeded, it would now break: it calls HashTable::fromCData()->releaseReference(), but current z-engine 8.4/master heads have removed releaseReference(). main's cd938a2 fixes the same leak the surviving way (refcount drop + rc_dtor_func).

main's CI on the #14 merge commit is fully green (run 31225063908), both soaks included — so with the dev constraints the z-engine 8.4-branch leak fix is already picked up and nothing is blocked on an 8.4.1 tag anymore.


Generated by Claude Code

@lisachenko lisachenko closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants