Skip to content

fix(derive): keep parsed fields live for lints - #1138

Merged
jdx merged 1 commit into
agent/clap-implicit-groupsfrom
agent/derive-field-liveness
Aug 21, 2026
Merged

jdx merged 1 commit into
agent/clap-implicit-groupsfrom
agent/derive-field-liveness

Conversation

@jdx

@jdx jdx commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Generated command construction now takes a shared reference to every parsed field. This preserves intentional parse-only compatibility flags under deny(dead_code) without adding optimized runtime work.

A facade regression compiles an ignored flag under #[deny(dead_code)], and PLAN records the adopter requirement.

This PR description was generated by Codex.


Note

Low Risk
Small derive codegen tweak plus a regression test; no change to parse semantics or security-sensitive paths.

Overview
Generated command construction now takes a shared reference to every parsed field so intentional parse-only compatibility flags no longer trip deny(dead_code).

The extra reads are expected to optimize away. A facade regression compiles an ignored flag under #[deny(dead_code)], and PLAN records the adopter requirement.

Reviewed by Cursor Bugbot for commit 04240b0. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: fef3bdb2-e75e-4d7c-a94e-90c3c6cc4ab3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Comment @coderabbitai help to get the list of available commands.

@jdx jdx changed the title agent/derive field liveness fix(derive): keep parsed fields live for lints Aug 20, 2026
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Instruction counts

Nothing was compared, and so nothing was gated. No series appears on both sides: either the base has no measurements recorded, or the two were measured on different runner classes, which are deliberately not comparable — counts shift between machine types by more than a real regression does.

New, nothing to compare against: markdown on bamboo-v2-ubuntu24.04-x64-30vcpu-24gb-rust1.97.1, startup on bamboo-v2-ubuntu24.04-x64-30vcpu-24gb-rust1.97.1

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

Shadow comparison

Parsing mise use -g node@20 against a shadow of mise's committed spec.
Reported, not gated: the shadow grows as the derive learns to express more, so
what to watch is the ratio rather than either column.

framework instructions, cold parse vs usage
usage 4355
argh 6292 1.4x
clap 5893640 1353x
bpaf 21917948 5032x
                                              min       p01       p10    median
usage-rs: argv -> struct                      196       199       203       209  ns
argh: argv -> struct                          283       288       294       303  ns
clap: build tree + parse -> struct         472668    474279    476382    482479  ns
bpaf: build parser + parse -> struct      1586268   1586268   1589490   1599909  ns

usage: argv -> struct                             218 ns      0.22 µs
clap: build tree + parse -> struct             488602 ns    488.60 µs
clap: parse -> struct, tree reused              23356 ns     23.36 µs
clap: build tree only                          301245 ns    301.25 µs

91537ccaf6be vs 2fdaff5f655c · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/derive-field-liveness branch from e6e5aae to a0150f2 Compare August 20, 2026 16:16
@jdx
jdx force-pushed the agent/derive-field-liveness branch from a0150f2 to eb802eb Compare August 20, 2026 16:27
@jdx
jdx force-pushed the agent/derive-field-liveness branch from eb802eb to 6ba0439 Compare August 20, 2026 16:35
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 6ba0439 to 6990d29 Compare August 20, 2026 17:11
@jdx
jdx force-pushed the agent/derive-field-liveness branch 2 times, most recently from 1bc38b6 to 368fd46 Compare August 21, 2026 01:50
@jdx
jdx force-pushed the agent/derive-field-liveness branch 2 times, most recently from 534269d to 532e347 Compare August 21, 2026 03:20
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 532e347 to 5507725 Compare August 21, 2026 03:40
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 5507725 to 60a6c59 Compare August 21, 2026 03:43
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 60a6c59 to 5507725 Compare August 21, 2026 03:49
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 5507725 to 15a2e99 Compare August 21, 2026 03:56
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 15a2e99 to 1627dab Compare August 21, 2026 04:10
@jdx
jdx force-pushed the agent/derive-field-liveness branch from de624db to e835371 Compare August 21, 2026 05:10
@jdx
jdx force-pushed the agent/derive-field-liveness branch from e835371 to 54bce9c Compare August 21, 2026 05:19
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 54bce9c to 082ebe7 Compare August 21, 2026 05:36
@jdx
jdx force-pushed the agent/derive-field-liveness branch 2 times, most recently from f8743cd to e1b5ca4 Compare August 21, 2026 06:08
@jdx
jdx force-pushed the agent/derive-field-liveness branch from e1b5ca4 to c97e6a3 Compare August 21, 2026 06:11
@jdx
jdx force-pushed the agent/derive-field-liveness branch from c97e6a3 to 20dba88 Compare August 21, 2026 06:23
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 20dba88 to 333ae43 Compare August 21, 2026 06:35
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 333ae43 to 47077c5 Compare August 21, 2026 06:46
@jdx
jdx force-pushed the agent/derive-field-liveness branch 3 times, most recently from a49903e to ce6f267 Compare August 21, 2026 07:23
@jdx
jdx force-pushed the agent/derive-field-liveness branch 2 times, most recently from 7a63589 to 91537cc Compare August 21, 2026 07:49
@jdx
jdx force-pushed the agent/derive-field-liveness branch from 91537cc to 04240b0 Compare August 21, 2026 08:32
@jdx
jdx merged commit eae89b9 into main Aug 21, 2026
8 of 9 checks passed
@jdx
jdx deleted the agent/derive-field-liveness branch August 21, 2026 09:18
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