Skip to content

fix(code-analysis): Rust forwarding and macro-template ownership - #1297

Draft
tt-a1i wants to merge 6 commits into
codex/rust-macro-call-evidencefrom
codex/rust-trait-forwarding-candidates
Draft

tt-a1i wants to merge 6 commits into
codex/rust-macro-call-evidencefrom
codex/rust-trait-forwarding-candidates

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Maintainers changing a Rust trait method need to see which source template calls it, where that template expands, and which targets remain uncertain. This Draft retains the v11 default-body/forwarding work and revises macro ownership against fixed baseline 70750e6ba, on the original branch. The branch includes #1296's statistics-only aa080c89b; that correction is not product benefit.

 physical macro-template call
- invocation cfg ignored; first impl retained as caller
+ combine impl / invocation / generated method / body cfg
+ excluded => absent; unknown => no known target
+ template-qualified caller + macro definition + all physical expansion origins
+ divergent targets => unknown; disputed callers => omit caller, keep agreed target

Current model: rust-source-direct-v12 / adapter 12. Expansion remains bounded to a preceding, same-module local macro with one empty matcher and no arguments, filling the entire impl body. This is not general macro expansion or concrete runtime dispatch analysis. Unknown accessor returns and unknown generated trait implementations remain ambiguity blockers; nested cfg_attr is respected.

Report and reader navigation · Exact replay script

Evidence

Before / after, fixed v11 baseline

Measure v11 70750e6ba Final v12 source / fresh ZIP
Bytes caller positions 2/2 2/2 / 2/2
Futures caller positions 1/2, partial 1/2 / 1/2, partial
Bytes and futures ownership first impl; no origins template identity and both real origins
Cfg control known references, off / on 3 / 6 0 / 5 in both distributions
Divergent-template target already unknown; first-impl caller unknown; both origins retained
Tracing regression 4/7 4/7 / 4/7
  • Original 20: both revisions score 81/86 correct, 5 missed, 0 wrong, 2 known extras; 20/20 definitions. All per-case position deltas are zero: no newly found real positions, no real-case wrong-target removals, no position regressions in v12. Counterexamples are derived from individual available/passed records: 152 total, 121 applicable and all passing, 31 N/A, 8 classes.
  • Answer-key correction is separate: rescoring identical raw baseline/candidate outputs with the old bytes key gives the same 79 correct / 6 missed / 1 wrong / 3 extras, with two stale-oracle mutation failures (119/121 applicable passing). Correcting source coordinates, caller kind and target class is not product gain. The historical v10→v11 gain of two bytes positions is not counted again.
  • Same-rule independent case: source-first futures-rs 446134c1..c0122993 uses deref_async_read! as the whole body of AsyncRead for Box<T> and AsyncRead for &'a mut T. Its split.rs:49 closure call remains in the denominator and remains missing. A separate arc_wake.rs parse error makes both captures partial; no modern upstream build is claimed. Tracing is regression-only, not validation of this macro rule.
  • Normal CLI controls: cfg attributes on invocation, generated method, outer impl and expression, unknown conditions, and divergent expansion targets pass 364/364 assertions in source and independently in ZIP, with 8/8 fixture/profile/side builds per run. Disabled calls are actually absent, not merely unresolved.
  • Module tests: 461 passed, 0 failed, 0 skipped, including 54 Rust tests. Review regressions cover unknown accessor/trait-impl competitors, nested cfg, physical deduplication, and caller disagreement without target loss. Historical v11 saved facts remain accepted; v12 provenance coordinates and freshness are validated.
  • Fresh ZIP: 405 files, SHA256 a61b2328c6b88127a324384e9ef536f42282ca41d4cd2d93290d1e774da5e6d9, official Node 22.23.2 / zlib 1.3.1-e00f703; second canonical build is byte-identical. All nine tested source/test hashes match final commit 3b09a193e69428c83cb0c5c0374c37d9c134adee. Isolated dependency installation reports eight npm audit warnings against unchanged dependencies (one moderate, seven high); no dependency upgrade or security clearance is claimed.
  • Independent reader: without answer keys or product diffs, the reader found bytes template 2461 / call 2836 / expansions 2887 and 2891, and futures template 244 / call 259 / expansions 265 and 269; they also identified the omitted closure by source reading. This predates final conservative ambiguity fixes and is reused at its original run identity, not relabeled final-head evidence. These paths establish trait declarations, not concrete runtime implementations.
  • Scoped improvement review: retain cfg state and provenance because they protect different guarantees; separate caller agreement from target agreement. Extend existing tests and CLI controls rather than add a parallel framework. No unrelated cleanup, capability removal or visual change.

Computed comparison, source hashes, review receipt and raw runs: final acceptance is under final/ and *-final.*; initial tooling-failed/cancelled batches and earlier ZIP evidence are explicitly nonfinal.

Final-head CI: 42592939655 completed successfully for 3b09a193e69428c83cb0c5c0374c37d9c134adee: 19 successful jobs; only the two deployment jobs skipped. Both full-regression shards, browser/WebM gates, Node compatibility, ZIP byte freshness, three-platform package smoke and Windows portability ran successfully. The Code Analysis module job actually executed 461 tests, all passing, none skipped, including the new cfg/provenance/unknown-impl regressions. The v11 run is not reused as final CI. Wiki investigation record.

Merge Danger

Door: two-way

Code and packaged artifact can be reverted. Historical v11 facts retain their original contract; new v12 callers intentionally identify a template rather than imply a unique impl. No persisted-data migration or live installation.

Blast Radius: code-analysis

Rust extraction, shared fact validation/query navigation, and packaged ZIP. Unknown/runtime targets remain conservative. This is source/CLI evidence, not complete Rust inference or upstream-project build acceptance. Keep Draft; do not merge. #1296 remains Draft; labs/code-analysis (bf0a29e76), live installations and releases are unchanged.

AI assistance and accountability

Qoder agent (model identity not recorded) performed investigation, implementation, tests, scoped review and report/PR drafting under @tt-a1i's direction. The origin combines real bytes/futures source cases and explicitly synthetic cfg/divergence review controls; no constructed probe is presented as an observed user incident. Accountable human: @tt-a1i.

  • I have personally reviewed the changes and explanation, understand their impact, and can answer review questions. (Awaiting human confirmation.)

Bind self calls in a trait default body to the enclosing declaration,
expand a zero-argument local macro used as an entire impl body, keep
*self/**self trait bounds, and mark macro-generated forwarding callers.
Concrete plain impls that do not override the method inherit the default;
overrides still resolve to the impl body. Bump Rust to v11.
Record the two real bytes misses, the compilable forwarding controls, the
baseline/candidate receipts, the corrected 20-case answer set, the tracing
cross-project case and the uninvolved reader report.
Rebuild the distributable archive with the canonical Node 22/zlib toolchain
and replay the bytes case, the tracing cross-project case and the forwarding
control from a fresh unpack.
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Keep template callers independent of impl order, retain expansion origins, and prevent unknown cfg evidence from selecting a unique target.
…corrections

Freeze cfg and divergent-template controls, retain source-first futures and reader evidence, and record final source/ZIP replays without claiming new real caller positions.
@tt-a1i tt-a1i changed the title fix(code-analysis): Rust trait-default and forwarding callers fix(code-analysis): Rust forwarding and macro-template ownership Nov 9, 2026

This branch has not been deployed

No deployments
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