Skip to content

Simplify effect args and providers - #1999

Merged
sbillig merged 8 commits into
fix/trait-key-provider-spacefrom
effects/simplify-args-providers
Nov 15, 2026
Merged

sbillig merged 8 commits into
fix/trait-key-provider-spacefrom
effects/simplify-args-providers

Conversation

@sbillig

@sbillig sbillig commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Removes effect arg and provider representations that have one reachable state since #1994–#1996. No behaviour change.

  • EffectArg is a with value or the caller's own effect binding. with_source and EffectPassMode are removed, and EffectEvidence is one struct.
  • EffectOrigin::Param holds the effect binding in place of a copy of its site and index. The missing-effect fallback and the provenance panic are removed.
  • Remove BarrierReason. Only its path was read, where the barrier is inserted.
  • Remove EffectKeyCanonMode. Stored was never constructed, and Solver and Compare took the same branch.
  • Remove EffectCommitPlan.extra_unifications, which was always empty, and the probe and rollback before a keyed type witness specializes its key.
  • ProviderSemantics.address_space is an AddressSpace, not an Option. NormalizeError::MissingProviderAddressSpace and the missing-space panic in MIR are removed.
  • runtime_class_for_provider replaces three functions that returned Option and never None.
  • Remove the unused effect_args of extern builtin calls.

Three Sonatina IR snapshots change symbol hashes and function order: the provider identity prints its space without Some.

An effect arg is always a place, so the arg variant, `with_source` and
the pass mode said one thing three ways. `EffectArg` is now a `with`
value or the caller's own effect binding, and the lowering takes the
place or temporary its `with` block captured.

`EffectEvidence` is one struct: a type key's evidence carries the type
it is provided as. This removes the pass-mode guard on unkeyed type
providers and the unreachable arms that went with it.
`EffectOrigin::Param` held an effect's site and index beside
`ProvidedEffect.binding`, an `Option` that was always `Some` for it with
the same site and index. The origin now holds the binding, and a `with`
value's origin the binding it names. An effect binding always gives an
effect arg and a provenance, so the missing-effect fallback and the
provenance panic go.
An effect barrier carried a reason with a span and the `with` key's
path. Lookups passed the reason along and dropped it; only the path was
read, where the barrier is inserted. A barrier is now its pattern, and
the insertion takes the path.
`Stored` was never constructed, and `Solver` and `Compare` took the same
branch, which is `normalize_effect_identity_ty` and
`normalize_effect_identity_trait`. Use those.
`EffectCommitPlan.extra_unifications` was always empty. A keyed type
witness probed the key match, rolled it back, then applied it again to
specialize the key, with the same error on either failure; the
specialization alone decides it now.
`ProviderSemantics.address_space` was always `Some`: `provider_semantics` sets memory and every other constructor sets a space. Store an `AddressSpace` and remove the fallbacks, the missing-space panic in MIR and `NormalizeError::MissingProviderAddressSpace`.

The provider identity prints the space without `Some`, which changes symbol hashes and function order in three Sonatina IR snapshots.
`runtime_class_for_effect_binding_provider_in_env` returned `Some` on every path, `runtime_class_for_direct_value_provider_in_env` was an alias of it, and callers chained one after the other and panicked on `None`. Replace both and `runtime_class_for_provider_binding` with `runtime_class_for_provider`, which returns the class.

Merge the two root-provider arms of `runtime_effect_binding_plan`.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T21:38:39.996827Z 511e974 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sbillig
sbillig added this pull request to stack #2001 November 13, 2026 21:37
@sbillig
sbillig merged commit 116f167 into master Nov 15, 2026
11 checks passed
@sbillig
sbillig deleted the effects/simplify-args-providers branch November 15, 2026 17:01
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