Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,16 @@ as permission to run Layer 2 or parallel code against a mismatched tree.

- `ffi.enable=1` — cannot be turned on at runtime.
- `opcache.jit=off` — the JIT rewrites the very executor internals the engine hooks depend on.
- `error_reporting=E_ALL & ~E_DEPRECATED` — the z-engine dev lines may report deprecations from
dependency code, and PHPUnit's `.phpt` runner forces `display_errors=1`, so an unsuppressed
deprecation is prepended to a test's captured output and fails an `--EXPECT--` block over noise.

Those two, and nothing else. A third line, `error_reporting=E_ALL & ~E_DEPRECATED`, used to sit
alongside them: PHPUnit's `.phpt` runner forces `display_errors=1`, so a deprecation raised by the
**dependency** — z-engine, back when it was consumed from a development branch — was prepended to a
test's captured output and failed an `--EXPECT--` block over noise. The stable releases now required
(`~8.4.2 || ~8.5.0`) raise none, and the suppression was hiding **this package's own** deprecations
too: that is how the `SplObjectStorage::contains()` call PHP 8.5 deprecated (#39) sat green through
12 tests. The suite now runs at the runner's default `error_reporting`, so a deprecation from our
code fails a test the day it appears. **Do not re-add a diagnostic filter to a `.phpt`** — the guard
test rejects any `error_reporting` line in an `--INI--` section.

```bash
php8.4 -d ffi.enable=1 -d opcache.jit=off vendor/bin/phpunit
Expand Down Expand Up @@ -360,10 +367,11 @@ version and a minimal reproducer, and report it.

The suite is PHPUnit 12 driving `.phpt` files in `tests/Functional/`, one behaviour per file.

- **`--INI--` is mandatory and carries all three lines.** The child processes the runner spawns
inherit nothing by luck. `tests/Functional/testEveryTestDeclaresTheThreeRequiredIniLines.phpt`
scans the whole suite — itself included — and fails naming the file and the missing setting, so a
new test cannot quietly omit one.
- **`--INI--` is mandatory and carries both lines** — `ffi.enable=1` and `opcache.jit=off`, and no
diagnostic filter beside them. The child processes the runner spawns inherit nothing by luck.
`tests/Functional/testEveryTestDeclaresTheTwoRequiredIniLines.phpt` scans the whole suite — itself
included — and fails naming the file and the missing setting, so a new test cannot quietly omit
one; it fails the same way on an `error_reporting` line that would silence a real bug.
- **`test<WhatItDoes>.phpt`**, and the `--TEST--` line says the behaviour, not the class.
- **Prefer `--EXPECT--`** (exact match). Tests about errors `echo` the caught message rather than
`var_dump()`ing it, so no string lengths need maintaining.
Expand Down
4 changes: 2 additions & 2 deletions src/Parallel/PreforkTaskDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct()
*/
public function register(Task $task): int
{
if ($this->addresses->contains($task)) {
if ($this->addresses->offsetExists($task)) {
return $this->addresses[$task];
}

Expand All @@ -91,7 +91,7 @@ public function register(Task $task): int

public function addressOf(Task $task): int
{
if (!$this->addresses->contains($task)) {
if (!$this->addresses->offsetExists($task)) {
throw new \LogicException(sprintf(
'%s was never published to the workers; without the shared arena (see #7) a task '
. 'can only reach a worker by being registered before the fork',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A buffered send parks only when the buffer is full, and a receive only when it i
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A call-free arithmetic loop does not starve another coroutine when the runtime i
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A call-free loop that starts after an idle stretch is preempted exactly as one t
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A rendezvous select abandoned by a cancelled context leaves no registration behi
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A run of cross-process rendezvous handoffs costs a bounded number of wakeups in
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ One select resolves a capacity-0 shared channel and a local channel, and unlinks
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A shared channel can be declared with capacity 0, and reports itself as a rendez
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A closed channel keeps delivering buffered values with ok = true, and only then
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A closed channel reports that both a send and a receive would complete without p
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A closure registered before the fork barrier is callable in a worker, and a late
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ The local view of a result slot is dropped once the handle that could still read
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A context takes part in a select through its done channel
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A runtime without workers maps no arena and refuses the shared surface with the
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A coroutine that never parks and never returns ends the run with a diagnosis ins
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
1 change: 0 additions & 1 deletion tests/Functional/testACriticalSectionIsNeverPreempted.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A coroutine inside a critical section keeps the CPU, and the deferred preemption
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ fork() clears the slice timer in the child, and rearmAfterFork() puts it back
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A handle on a recycled slot id is refused rather than answered with the result o
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A local channel exposes no readiness descriptor, because nothing outside the pro
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A panic slot whose detail does not attach as a SharedError says so, instead of p
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A task that ends in an uncaught throwable fails its waiter and leaves the worker
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A sender that was already parked when the channel closed throws
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
1 change: 0 additions & 1 deletion tests/Functional/testAPoolOutlivesItsResultSlotSupply.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A pool spawning far more tasks than the slot supply runs to completion, reusing
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A preempted coroutine refuses to be thrown into, while a coroutine that suspende
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A preempted coroutine that goes on to park on a channel is drained out of the ca
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A control record delivered in two pieces is held back until all 16 bytes are the
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A receive on a capacity-0 shared channel parks on the poller until another proce
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A send on a capacity-0 shared channel returns only once another process has take
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A coroutine parked on a capacity-0 shared channel is not reported as a deadlock
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A result slot opened by the parent is awaited from inside a different worker
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A capacity-0 shared channel that lost a select is no longer a rendezvous partner
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A capacity-0 shared channel cannot be a select send case, and the refusal names
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ One select over a shared channel and a local channel resolves both, the shared o
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A result slot read under contention never shows a tag from one generation and a
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A result slot is claimed and given back while a rendezvous send waits for its va
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A task dispatched to a worker runs there and its integer result comes back to th
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
1 change: 0 additions & 1 deletion tests/Functional/testATaskCanBePinnedToOneWorker.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A task pinned to a worker always runs there, and pinning to a worker that is not
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A task panic reaches the waiter as a ParallelTaskException carrying class, messa
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Slice ticks that land outside any coroutine are harmless and preempt nothing
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A worker whose parent is SIGKILLed exits on control-socket EOF instead of becomi
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A call-free loop inside a task does not starve another coroutine in that same wo
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A worker killed while it holds an arena lock fails its waiter instead of hanging
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A worker killed inside an arena critical section is reported as a recovered lock
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ A worker mutates a shared object and the parent observes it on the very same ins
--INI--
ffi.enable=1
opcache.jit=off
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php

Expand Down
Loading