Skip to content

chore: sharp/bin/native leaves the spec guard - #117

Merged
heyJordanParker merged 1 commit into
masterfrom
chore/native-outside-guard
Oct 13, 2026
Merged

heyJordanParker merged 1 commit into
masterfrom
chore/native-outside-guard

Conversation

@heyJordanParker

Copy link
Copy Markdown
Owner

Problem

SPEC_GUARD guards every file in sharp/bin/. So an engine pull request that changes sharp/bin/native is refused. sharp/bin/native is the generator that writes the engine's C header from the standard library's extern declarations, and it measures no example.

Solution

sharp/bin/spec keeps every GUARDED folder and adds UNGUARDED, which names sharp/bin/native alone. guarded() skips that one path. Every other file in sharp/bin/ stays guarded, a file added later included.

sharp/
├── bin/spec                          UNGUARDED, read by guarded()
└── README.md                         names the one unguarded file
docs/
└── architecture/spec-examples.md     the same, and the files tree

Proof

Each checker ran from a copy outside any repository, as CI runs it from $RUNNER_TEMP. Each run used --base origin/master, in php-sharp feat/extensions, which changes sharp/bin/native with engine code.

This branch's checker passes, with exit 0:

0 entries join sharp/baseline/spec, 1 leave it.

Master's checker refuses the same tree, with exit 1:

sharp/bin/native changed. This PR also changes Zend/tests/sharp/Accessors.sharp, Zend/tests/sharp/WalletExtensions.sharp, Zend/tests/sharp/WalletReport.sharp, Zend/tests/sharp/extensions.phpt, Zend/tests/sharp/harness/Wallet.inc, ext/sharp/sharp.c, ext/sharp/sharp_native.h, ext/sharp/sharp_unit.h, sharp/composer/library/Sharp/Text/Text.sharp, and examples and the files in sharp/harness/, sharp/bin/, sharp/docker/, .github/ change only in a spec PR.
0 entries join sharp/baseline/spec, 1 leave it.

A change to sharp/bin/spec beside engine code still fails. The tree was this branch plus a one-line comment in ext/sharp/sharp_unit.h, removed afterwards, and the run exits 1:

sharp/bin/spec changed. This PR also changes ext/sharp/sharp_unit.h, and examples and the files in sharp/harness/, sharp/bin/, sharp/docker/, .github/ change only in a spec PR.

The checker still checks:

  • --self-test: 17 of 17.
  • The full run: 166 checked, 2 ignored, 99 fail, the same as master's list.

No self-test row covers the guard, because that would need a git fixture for a one-path change.

Problem

SPEC_GUARD guards every file in sharp/bin/, so an engine pull request that
changes sharp/bin/native, the generator that writes the engine's C header from
the standard library's extern declarations, is refused. sharp/bin/native
measures no example.

Solution

sharp/bin/spec keeps every GUARDED folder and adds UNGUARDED, which names
sharp/bin/native alone. Every other file in sharp/bin/, a new one included,
stays guarded.

sharp/
├── bin/spec                          UNGUARDED, read by guarded()
└── README.md                         names the one unguarded file
docs/
└── architecture/spec-examples.md     the same, and the files tree
@heyJordanParker
heyJordanParker merged commit 6792e2b into master Oct 13, 2026
12 checks passed
heyJordanParker added a commit that referenced this pull request Oct 13, 2026
Problem: the generics slice branched from master c3a4a3c. Master since
gained effects on function types (#126), private fields with no modifier
(#128), union collections (#116), the sortedBy key rule (#125), macOS and
Linux CI (#127), function uses (#122) and message fixes (#117). Ten files
conflicted, and one master test named a syntax field the slice renamed.

Solution: every conflict keeps both sides' behavior.
- A refused expression has the error type in PHP# and `never` in PHP, as
  master types it, and `is_refused` keeps the slice's wider set of refused
  generic expressions.
- An argument is a possible mismatch only when the parts it may share with
  the parameter, as `shareable_part` takes them, fit through master's
  `can_argument_be_identical`, and `verify_argument_type` returns whether
  the argument fits, as master's effect rules read it.
- A method value's signature names the class it is read through, as master
  needs for `extern` lookups, while the slice still specializes it for its
  receiver and fixes its type arguments.
- A PHP# literal's backed enum key and master's other new calls pass the
  dialect `get_backing_key_type` takes on the slice.
- Comparisons master added use the slice's `ComparisonResult::for_dialect`.

crates/
├── analyzer/src/
│   ├── artifacts.rs                         tested_types beside function_values
│   ├── expression/
│   │   ├── array.rs                         master's PHP# key branch, with the dialect
│   │   ├── assignment/array_assignment.rs   every declared element, for_dialect
│   │   └── mod.rs                           slice's is_refused, master's error type
│   ├── invocation/arguments.rs              shareable_part over can_argument_be_identical
│   ├── resolver/
│   │   ├── method.rs                        declared collections, paired with their written atomic
│   │   └── property.rs                      method value source is the read-through class
│   └── statement/
│       ├── class_like/property.rs           for_dialect, records fitting function values
│       └── function_like/mod.rs             passes tested_types and function_values up
├── codex/src/scanner/ttype.rs               function type keeps its effects and its type parameters
└── syntax/tests/sharp.rs                    effects test reads type_arguments.arguments
@heyJordanParker
heyJordanParker deleted the chore/native-outside-guard branch November 3, 2026 22:07
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