Skip to content

feat(compiler): implement Stage 36 property hooks - #192

Merged
amasiye merged 2 commits into
mainfrom
develop
Oct 4, 2026
Merged

amasiye merged 2 commits into
mainfrom
develop

Conversation

@amasiye

@amasiye amasiye commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implement Stage 36 property hooks under Decision 0135 through the checked compiler pipeline.

  • Computed and automatically backed getters/setters, explicit writable get, borrowed get, typed setter inputs, and checked effects.
  • Concrete, interface, constrained-generic, trait, and inherited accessor dispatch; exactly-once read-modify-write.
  • Parent declaration initializers run before child initializers over one inherited backing slot. Replacement acquires the child value before releasing the parent value, without invoking setters. Failed construction cleans initialized fields and completed ancestor phases only.
  • Shared ownership/provenance fixes distinguish an owned return carrier from the source it retains, preserve repeatable captures, and keep nullable and selected-place borrows sound across the backends.
  • Transitive nonblocking analysis includes helpers, callbacks, and cleanup. PHP nominal names are isolated from host reserved names and case folding.

Removed Or Corrected Boundaries

  • Remove the blanket E0764 hook-execution rejection.
  • Remove false readonly-collection-read and shared-handle-return-borrow rejections, premature repeatable-capture cleanup, and spurious ambient I/O effects only where actual callback provenance proves otherwise.
  • Reject genuinely blocking/async hook work transitively, including output.
  • Preserve PHP's existing numeric compatibility diagnostics; do not substitute host overflow or float-formatting semantics.

Validation

  • php scripts/validate_work_unit.php --llvm: passed on macOS ARM64, including formatting, both Clippy configurations, production builds, workspace tests, and LLVM suites.
  • Durable native manifest: all 389 examples pass interpreter/Cranelift/LLVM comparison of output, status, and declared file effects. Both default and LLVM parity suites passed all 11 tests.
  • Property hooks: 87 tests; parent/child initialization: 16 tests. PHP, ownership, cleanup, malformed-MIR, and retained-closure regressions passed.
  • macOS leak checks on successful and failing parent/child initialization report zero leaks with both native backends. The checker reports restricted-process memory visibility; a prior positive control confirmed leak detection. Linux Valgrind coverage is wired into CI and is not claimed as locally executed.
  • Documentation authority, diagnostic style, build-artifact policy, remote dependency pins, and diff checks passed.
  • Exact-head Linux/macOS/Windows CI remains the merge gate.

Invalidated Elsewhere

Language-server traversal, highlighting, hover, navigation, receiver/accessor facts, diagnostics, and compiler pin require the coordinated Stage 36 update. Website guides, API reference, tutorials, and playground examples must retain the accepted target-state contracts. Companion integration and installed-toolchain refresh are still pending; this PR does not yet claim overall Stage 36 closure.

Remove the blanket E0764 execution gate and implement checked accessors,
automatic backing fields, exact typed setters, borrowed results, and
interface/trait/override dispatch through the shared compiler pipeline.

Run parent then child declaration initializers over one backing slot.
Acquire replacements before release and clean only initialized fields and
completed ancestor phases on constructor failure.

Remove false shared-handle return-borrow and readonly collection-read
rejections. Distinguish owned result carriers from retained source loans,
keep repeatable captures until environment destruction, and remove spurious
ambient I/O effects only when callback provenance proves the actual effects.
Reject genuinely blocking/async hook work transitively, including output.

Isolate emitted PHP nominal type names from host reserved names and case
folding; preserve its existing numeric compatibility diagnostics.

Add public-pipeline, malformed-MIR, durable parity, and ownership regressions;
update authority, API guidance, tooling facts, and CI coverage.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Replace the stale inline shared-property source check with the shared type contract and require its readonly, ownership, and availability regressions.

Run the same documentation authority suite locally and in CI. Remove duplicate CI invocations without removing coverage, and run authority and diagnostic checks before canonical compiler builds. No language behavior is removed.

Validation: all authority and diagnostic guards pass, the canonical LLVM plan includes them, and five focused shared-property regressions pass. Invalidated elsewhere: local validation now includes the previously CI-only authority checks.
@amasiye
amasiye merged commit 8f347f6 into main Oct 4, 2026
10 checks passed
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.

1 participant