Skip to content

refactor(entity)!: speculation paths carry assumptions, not bets - #473

Open
behinddwalls wants to merge 1 commit into
mainfrom
preetam/speculation-assumptions
Open

refactor(entity)!: speculation paths carry assumptions, not bets#473
behinddwalls wants to merge 1 commit into
mainfrom
preetam/speculation-assumptions

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Rename the speculation path model from betting vocabulary to assumptions, so the terms explain themselves without a glossary: a path assumes an outcome for every dependency and builds the batch under those assumptions; when a dependency resolves against an assumption, the path is refuted. "The assumption was violated" is ordinary engineering speech, where "the bet was broken" needed the metaphor explained first.

DependencyBetType becomes DependencyAssumption, dropping the Type suffix that made every field read bet.Bet. DependencyBet becomes PathDependency — one dependency of a path's head plus what the path assumes about it — so SpeculationPath.Dependencies mirrors Batch.Dependencies one level richer, and nothing stutters.

The values change with the names: included/excluded/dropped become succeeds/fails/ignored. Succeeds and Fails mirror BatchStateSucceeded and BatchStateFailed, so resolving an assumption against a batch's state is a direct comparison rather than a translation; Fails covers a cancelled dependency too, which also does not succeed. Ignored replaces Dropped because the value means the path makes no assumption at all — its outcome neither gates the merge nor refutes the path — where "dropped" described what relaxation did to it rather than what the path now believes.

Path IDs hash these values, so every path ID changes. That is safe only because nothing persists them yet: there is no path store, no schema, and no controller reads them. The window closes once speculation is wired up.

CandidatePath.RankingScore is left implementation-defined: higher sorts first, on a scale the Generator chooses, meaningful only within the run. Consumers order by it without interpreting it.

The RFC drops its copied Go declarations in favour of prose and links to the packages, so the two cannot drift — the copies had already gone stale on Version's type and the timestamp field names. Its relaxation section used "drop" and "ignore" for the same thing and now uses one, and the Generator contract states that ranking is implementation-defined rather than mandating one implementation's scale.

Also drops the stale "depth bound" from the Speculator's Factory doc and README. Lazy generation removed the 2^n cost the bound existed to cap, so nothing injects one.

Stack

  1. @ refactor(entity)!: speculation paths carry assumptions, not bets #473
  2. feat(speculation): generator contract and bestfirst impl #446
  3. feat(speculation): allocator contract and sticky impl #450
  4. feat(speculation): standard composed speculator #451

Rename the speculation path model from betting vocabulary to assumptions, so the terms explain themselves without a glossary: a path assumes an outcome for every dependency and builds the batch under those assumptions; when a dependency resolves against an assumption, the path is refuted. "The assumption was violated" is ordinary engineering speech, where "the bet was broken" needed the metaphor explained first.

DependencyBetType becomes DependencyAssumption, dropping the Type suffix that made every field read bet.Bet. DependencyBet becomes PathDependency — one dependency of a path's head plus what the path assumes about it — so SpeculationPath.Dependencies mirrors Batch.Dependencies one level richer, and nothing stutters.

The values change with the names: included/excluded/dropped become succeeds/fails/ignored. Succeeds and Fails mirror BatchStateSucceeded and BatchStateFailed, so resolving an assumption against a batch's state is a direct comparison rather than a translation; Fails covers a cancelled dependency too, which also does not succeed. Ignored replaces Dropped because the value means the path makes no assumption at all — its outcome neither gates the merge nor refutes the path — where "dropped" described what relaxation did to it rather than what the path now believes.

Path IDs hash these values, so every path ID changes. That is safe only because nothing persists them yet: there is no path store, no schema, and no controller reads them. The window closes once speculation is wired up.

CandidatePath.RankingScore is left implementation-defined: higher sorts first, on a scale the Generator chooses, meaningful only within the run. Consumers order by it without interpreting it.

The RFC drops its copied Go declarations in favour of prose and links to the packages, so the two cannot drift — the copies had already gone stale on Version's type and the timestamp field names. Its relaxation section used "drop" and "ignore" for the same thing and now uses one, and the Generator contract states that ranking is implementation-defined rather than mandating one implementation's scale.

Also drops the stale "depth bound" from the Speculator's Factory doc and README. Lazy generation removed the 2^n cost the bound existed to cap, so nothing injects one.
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