Skip to content

E0277 root A residual (1): fn-generic bound inference is Clone-only — audience_subset/audience_join call rc_set_union<T: Ord + Clone> without their own signature earning P: Ord - #8771

Closed
briansrls wants to merge 2 commits into
mainfrom
session/tidy-otter-493

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session tidy-otter-493.
Pushing to session/tidy-otter-493 advances this PR.

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

Brian Searls and others added 2 commits August 21, 2026 13:00
…audience_join

v1's fn-generic bound-inference mechanism only ever derived Clone bounds
for generic function parameters, so a generic reaching the set_union
builtin (which lowers to rc_set_union<T: Ord + Clone>) emitted without
its own P: Ord, producing E0277 at the call site. audience_subset and
audience_join in dag/std/authorization_profile.dag are the two real
specimens (E0277 root A residual, dashboard node://adhoc-a9f61ade-340).

Adds a narrowly-scoped third trigger alongside the existing Clone-bound
machinery: a pure decision core (v1_set_union_ord_bound_param_names in
trait_bound_witness.dag), a Node-consuming body walker that locates
set_union call sites and resolves their element-type argument names
(05_emit_rust.dag, mirroring ownership.dag's collect_callable_refs, plus
an ExprBinOp arm that precedent lacks -- needed because audience_subset's
set_union call sits inside a == comparison), and a sibling renderer
(v1_emit_type_params_with_clone_and_ord_bounds in trait_derive_emit.dag)
wired into emit_fn_def alongside the existing Clone-only renderer.

Scoped to the set_union builtin's known lowering only -- not a general
trait-bound inference system, and does not touch the separate Root A
Ord-5 population on EnumeratedAudience's own struct derive.

Verified by regenerating v1's own compiler from these .dag sources and
re-emitting dag/std/authorization_profile.dag through the candidate
gunbc: audience_subset and audience_join now emit <P: Ord + Clone>; all
other Clone-only generic signatures in the import closure (ordering_fold,
effect_access_request, list_length, etc.) are unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Commits the src/v1/stage0/src/*.rs mirror produced by
--required-regen for the three .dag edits in dde8ac2. Closes
PR #8761's CI regen-drift failure: the prior commit only carried
the .dag sources, not their regenerated Rust mirror, so
required-regen (and its downstream receipt phase) correctly
flagged drift on v1_compiler_emit_rust.rs,
v1_compiler_trait_bound_witness.rs, and
v1_compiler_trait_derive_emit.rs.

Verified: sha256 of each mirror file matches the candidate
produced by target/stage0-regen-candidate/src (built from a
gunbc compiled against these committed .dag sources), and the
diffs are exactly the new Ord-bound rendering/decision-core
additions plus the ExprBinOp walker case, no unrelated drift.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@briansrls
briansrls marked this pull request as ready for review August 21, 2026 15:48
@gunbai-bot

gunbai-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Closing: this is an auto-opened ghost of superseded work, not a proposal.

The dashboard opened this against session/tidy-otter-493 because the branch still carries the commits from #8761 after that PR was closed. The body is the untouched template (TODO summary, unchecked attestation) and the diff is the same 475 additions — nobody authored this as a submission.

Why the underlying work was superseded (agreed with its author before either session archived): it infers a trait bound by recognizing set_union call sites by name — its own body said "scoped to the set_union builtin's known lowering only, not a general trait-bound inference system." That is a heuristic standing where a structural fact was available. Once AudienceSet<P> carries an item-level P: Ord, fn audience_subset<P>(left: AudienceSet<P>, …) earns the bound by naming an Ord-bounded declared type — no walker, no builtin name. Checked three ways independently before the call: exactly two generic set_union call sites exist in the corpus, both naming AudienceSet<P> at value-param position, so no specimen requires the walker.

The author reached that conclusion themselves and named their own mechanism as the failure DESIGN §4 describes.

The subsuming work is #8770, whose successor lane is node://adhoc-630ac7f9-6e6. Since #8699 landed on main — generalizing the type-param renderer to a per-parameter trait map — the replacement is concrete rather than theoretical: the general rule feeds bounds_by_param into a renderer that now exists.

The branch is deliberately retained, not deleted, for the evidence recorded on #8770. Note that the auto-opener will keep re-raising a PR while the branch has commits — if that becomes noise, the branch can go once that evidence is captured elsewhere.

— sent from bright-moth-92

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