Skip to content

DOC: Add the bind fast-path task note to devnotes - #270

Merged
fumitoh merged 1 commit into
mainfrom
docs/bind-fastpath-note
Aug 25, 2026
Merged

fumitoh merged 1 commit into
mainfrom
docs/bind-fastpath-note

Conversation

@fumitoh

@fumitoh fumitoh commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Files the working instruction that #269 was implemented from, alongside IOSpecLiteralTask.md and CoreRefactorDesign.md. Renamed from BIND-FASTPATH-PLAN.md to match the directory's CamelCase convention; the content is verbatim.

Docs only — no code changes.

Why keep it

It records what the implementation cannot:

  • The measurements that motivated the change — 15,914,995 bind sites over the 28 lifelib-products models, and the finding that 99.999% of them enter at CellsImpl.call rather than Cells.__call__, which is why the fast path is in get_node() and not at the obvious call site.
  • The decision table behind the guard, including the two results that are easy to get backwards: defaults do not need excluding, and POSITIONAL_ONLY does not need excluding.
  • The two traps only adversarial review found — find_match() passing a list rather than a tuple, and ParamFunc.__slots__ = () shadowing the base tuple so _copy_other copied nothing. Neither is exercised by the 15.9M-call workload, so measurement alone would never have surfaced them.
  • The approaches ruled out (§6), so they are not retried: lru_cache on _bind_args, caching bound keys per (args, kwargs), consulting obj.data before the key exists, and putting the guard inside _bind_args.

Where it differs from what landed

Two deliberate deviations, both recorded in 58f2aef's commit message rather than edited into the note:

  • _bind_tails also fast-paths default-reliant short calls, which §3 marks as slow-path. That took the measured hit rate from the note's 99.22% to 100.00%.
  • §5's ParamFunc question was resolved by fixing _copy_other to iterate Formula.__slots__, not by documenting the exception.

🤖 Generated with Claude Code

The working instruction that PR #269 was implemented from, filed
verbatim alongside IOSpecLiteralTask.md and CoreRefactorDesign.md.
Renamed from BIND-FASTPATH-PLAN.md to match the directory's convention.

It records what the implementation cannot: the measurements that
motivated the change, the decision table behind the guard, the two
traps that only adversarial review found (find_match passing a list,
and ParamFunc.__slots__ shadowing the base tuple), and the approaches
ruled out so they are not retried.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fumitoh
fumitoh merged commit 84b155b into main Aug 25, 2026
18 checks passed
@fumitoh
fumitoh deleted the docs/bind-fastpath-note branch August 25, 2026 15:16
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