Repository navigation
1.0 hardening: upstream-drift fixes, hydration correctness, Laravel floors - #3
Merged
Merged
Conversation
…rked) The clean_input_ab "large" arm was wide-and-shallow (100 leaves, depth 3), which misses the cost dimension that actually motivates the tier: vanilla's TransformsRequest rebuilds the dotted $keyPrefix.$key at every node, so the penalty grows with DEPTH, not just leaf count. Add a ProseMirror/TipTap-style deep content post (1,125 leaves, depth 17) — the shape a real CMS body submits — and surface depth alongside leaf count in the report. Vanilla burns ~1.2ms of pure middleware on it before the controller runs; greased holds ~−35%. The deep arm fingered the inherited per-node prefix concat as the shared bottleneck. Spiked an all-shallow except fast path (skip the prefix build + except check below depth 1 when every except pattern is a dot-free, wildcard- free literal — the default): −9.1% vs shipped on the deep payload, free elsewhere, byte-identical incl. the adversarial nested-'password' case. PASSED for now (−9% on a slice-of-a-slice, macOS numbers, a third overridden walk method of parity surface) — documented in LEADS.md with the mechanism captured for a Linux-confirm revisit. Spike itself was throwaway. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…reshes] The slim newFromBuilder built hydrated rows from class defaults, skipping the two things vanilla's newInstance() carries from the *prototype*: - its casts — so query-time casting (Model::query()->withCasts([...])) was silently ignored on every hydrated row; - its table — so a runtime setTable() on the model a query is built from produced rows whose save()/delete() targeted the class table. Both now match vanilla. The casts check is a pointer compare until the prototype diverges; getTable() memoizes the derived (no-$table) name per class so correct hydration costs ~5-10%/row over the old path instead of a per-row pluralStudly(). Also snapshot 13.33's $refreshes in initializeModelAttributes (the warm path dropped it: every model after the first per class lost refresh-after-write). HasGreaseWholeStateParityTest is the net that catches this class of bug: it compares the entire instance state against vanilla (cold / warm / hydrated) for a model carrying every Eloquent class attribute, with a tripwire that fails when Laravel adds an attribute class the fixtures don't cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Laravel patch releases since the last CI run changed methods Grease overrides: - resolveClassAttribute (13.21/13.22): key includes the property; attributes on traits are resolved. Cache reshaped to [class][attr][property], single fetch — still ~11% faster than vanilla warm (benchmarks/class_attribute_ab.php). - Request::all (13.26): input keys keep position and win a file collision. 12.x kept the old merge, so the order is behaviour-probed once per process. - route() params (12.69.2/13.31): %, ? and # are escaped; the URL fast path emitted them raw, truncating the path into a query string / fragment. - ComponentAttributeBag::merge (12.63/13.19): a style default gets its ';'. Each has parity cases that fail without the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Require each supported major's current patch line so Grease mirrors the latest vanilla behaviour without per-patch branches. - CI: weekly schedule + workflow_dispatch (upstream drift now fails within days, not at the next push), and a lowest-deps leg proving the 13 floor. - Livewire proof widened to ^3.0 || ^4.0 (normalize v4's wire:name, which is the twin components' own names). - Pipeline probe subprocess ignores E_DEPRECATED so old deps on a new PHP can't corrupt its JSON. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vanilla re-derives Str::snake(Str::pluralStudly()) on every getTable() for a convention-named model: ~2.2us/call vs ~81ns memoized (-96%, macOS), and a 20-row get() calls it 23 times. Every existing fixture declares $table, so no other bench exercises the default Laravel shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tTable only Review of #3: the trait-level getTable() override froze an instance-dependent parent getTable() (sharding) to its first result, and collided fatally with any other trait defining getTable() (`use AsPivot, HasGrease;` no longer loaded). Drop the trait getTable() entirely; newFromBuilder memoizes the derived name per class only when the model inherits vanilla Model::getTable(), and calls any override per row exactly as vanilla. Tests: sharded override parity across prototypes, AsPivot + HasGrease composes and hydrates identically. Bench re-pointed at what's optimized: convention-named hydration, -74% vs vanilla with the correct table (macOS; confirm on Linux). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
serpentblade
marked this pull request as ready for review
September 29, 2026 18:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-1.0 deep dive. Validated locally on Laravel 13.34 (latest), 13.33.0 (floor, lowest deps) and 12.69.2 (floor, lowest deps); this PR runs the full matrix.
Hydration correctness (independent of Laravel version)
withCasts()was ignored on hydrated rows; a runtimesetTable()on the query's model produced rows whosesave()/delete()hit the class table. The slimnewFromBuildernow carries the prototype's table + casts like vanilla'snewInstance(). The caveat for this is removed.getTable()memoizes the derived table name per class, so correct hydration costs ~5–10%/row over the old path.Upstream drift since the last CI run (June)
#[Refreshes]dropped by hydration snapshotresolveClassAttributekey includes propertyresolveClassAttributewalks traitsRequest::all()input-over-files order (probed; 12.x unchanged)%/?/#styledefault gets;in attribute mergeGuardrails
HasGreaseWholeStateParityTest: compares the entire model instance state against vanilla (cold / warm / hydrated), plus a tripwire that fails when Laravel adds an Eloquent attribute class.^12.69.2 || ^13.33. Livewire proof now also covers v4.🤖 Generated with Claude Code