Skip to content

feat(gamma): extend enum mutations and harden campaigns - #342

Merged
Martin Taillefer (geeknoid) merged 1 commit into
mainfrom
gamma
Nov 5, 2026
Merged

Martin Taillefer (geeknoid) merged 1 commit into
mainfrom
gamma

Conversation

@geeknoid

@geeknoid Martin Taillefer (geeknoid) commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add ControlFlow and Ordering mutations with stronger source-visible type and Default-identity evidence; remove the Default-only preflight.
  • Remove the experimental gamma::ignore feature and its selected-test argument expansion; preserve ordinary --skip filters and resource scheduling.
  • Repair imported compiler-exclusion revalidation and extern-root alias provenance, and add focused mutation-regression coverage.
  • Improve bounded failure diagnostics, test listing, Windows runtime startup, stack sizing, and resumable snapshots with covered directory symlinks.
  • Use floating-point total ordering in cargo-aprz suggestion and risk-report sorting, giving NaNs a defined order instead of treating unordered comparisons as equal.

Verification

  • Focused unit tests and strict all-target/all-feature Clippy passed for the affected crates.
  • Added regression tests for original CI survivors and accounted separately for removed operations and narrowly documented equivalents/native adapters. All original cases now have static test evidence or a narrow documented disposition; fresh CI determines actual residuals.
  • Fresh mutation results and remaining platform checks are validated by PR CI. Static survivor accounting is not a measured kill count.
  • No mutation campaigns or Miri run locally.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

ControlFlow mutation eligibility accepts shadowed types without proven Default support, and its regression test can pass on an unrelated panic.

3 open issues
What changed in this PR

This PR expands Gamma’s mutation coverage and strengthens campaign execution across the engine, runtime, coordinator, and attribute crates.

Changes:

  • Adds ControlFlow and comparison Ordering mutations, tighter Default evidence, and version-8 mutant identities.
  • Adds mutation-only #[gamma::ignore] annotations and per-binary test filtering.
  • Improves failure diagnostics, Windows startup ordering, stack headroom, and campaign recovery documentation and regression coverage.
File Description
crates/​cargo-gamma/​src/​main.rs Documents test exclusions and revised compiler-test advice.
crates/​cargo-gamma/​README.md Updates generated user guidance.
crates/​cargo-gamma/​docs/​TODO.md Plans compiler-isolation optimizations and benchmarks.
crates/​cargo-gamma/​docs/​MUTATORS.md Documents new mutators and default-evidence policy.
crates/​cargo-gamma/​docs/​DESIGN.md Updates identity, filtering, and recovery contracts.
crates/​cargo-gamma/​docs/​CONFIG.md Explains individual test exclusions and configuration behavior.
crates/​cargo-gamma-rt/​tests/​windows_startup.rs Adds constructor-order regression tests.
crates/​cargo-gamma-rt/​tests/​mutation.rs Tests witnessed defaults and ControlFlow propagation.
crates/​cargo-gamma-rt/​src/​runtime.rs Installs Windows runtime state before ordinary constructors.
crates/​cargo-gamma-rt/​src/​mutation.rs Adds witnessed defaults and ControlFlow support.
crates/​cargo-gamma-rt/​src/​lib.rs Exports the helper and documents startup ordering.
crates/​cargo-gamma-rt/​docs/​DESIGN.md Records helper semantics and Windows initialization guarantees.
crates/​cargo-gamma-lib/​tests/​type_evidence_tests/​mod.rs Refines positive type-evidence assertions.
crates/​cargo-gamma-lib/​tests/​session.rs Adjusts unviable fixtures and removes foreign-config warning coverage.
crates/​cargo-gamma-lib/​tests/​native_regressions.rs Adapts tests to simplified configuration loading.
crates/​cargo-gamma-lib/​tests/​mutation_correctness.rs Adds compiler-backed mutation regressions.
crates/​cargo-gamma-lib/​tests/​fixtures/​sarif.golden.json Updates fingerprint scheme to version 8.
crates/​cargo-gamma-lib/​tests/​fixtures/​report.golden.json Updates report identity metadata.
crates/​cargo-gamma-lib/​tests/​fixtures/​correctness/​std_enums.rs Adds standard-enum mutation subjects.
crates/​cargo-gamma-lib/​tests/​fixtures/​correctness/​std_enums.expected.rs Pins emitted enum-mutation schemas.
crates/​cargo-gamma-lib/​tests/​fixtures/​correctness/​cold_campaign.rs Adds campaign-regression subjects.
crates/​cargo-gamma-lib/​tests/​fixtures/​correctness/​cold_campaign.expected.rs Pins repaired campaign schemas.
crates/​cargo-gamma-lib/​tests/​docs.rs Updates preset documentation expectations.
crates/​cargo-gamma-lib/​tests/​discovery/​type_identities.rs Tests withholding unproven defaults.
crates/​cargo-gamma-lib/​src/​suppress/​tests.rs Distinguishes test exclusions from mutant suppression.
crates/​cargo-gamma-lib/​src/​suppress/​scan.rs Recognizes ignore attributes and rejects comment equivalents.
crates/​cargo-gamma-lib/​src/​exec/​workspace.rs Adds per-binary arguments and artifact-retention tests.
crates/​cargo-gamma-lib/​src/​exec/​verdict.rs Applies per-binary filters to test launches.
crates/​cargo-gamma-lib/​src/​exec/​sweep/​staged.rs Filters hinted probes by binary policy.
crates/​cargo-gamma-lib/​src/​exec/​process_output.rs Adds bounded, labeled failure excerpts.
crates/​cargo-gamma-lib/​src/​exec/​nextest.rs Passes binary-specific harness arguments to nextest.
crates/​cargo-gamma-lib/​src/​exec/​mod.rs Registers shared process-output formatting.
crates/​cargo-gamma-lib/​src/​exec/​measure.rs Updates exclusion progress and warning expectations.
crates/​cargo-gamma-lib/​src/​exec/​loader.rs Raises test-thread stack floor to 32 MiB.
crates/​cargo-gamma-lib/​src/​exec/​harness_filters.rs Adds skip-filter admission checks.
crates/​cargo-gamma-lib/​src/​exec/​build/​tests.rs Tests richer Cargo failure diagnostics.
crates/​cargo-gamma-lib/​src/​exec/​build/​isolation.rs Confirms positional candidates using the failed invocation.
crates/​cargo-gamma-lib/​src/​exec/​build/​invoke.rs Captures Cargo exit status and arguments.
crates/​cargo-gamma-lib/​src/​exec/​build/​complaints.rs Cleans and bounds diagnostic output.
crates/​cargo-gamma-lib/​src/​exec/​build/​blame.rs Treats deletion containment as provisional evidence.
crates/​cargo-gamma-lib/​src/​docs.rs Adds descriptions for new mutation families.
crates/​cargo-gamma-lib/​src/​discover/​survey.rs Updates discovery expectations for stricter defaults.
crates/​cargo-gamma-lib/​src/​discover/​compile_fail.rs Uses identifier-based detection and targeted advice.
crates/​cargo-gamma-lib/​src/​config.rs Removes foreign-configuration probing.
crates/​cargo-gamma-lib/​src/​commands/​run/​recovery_test_util.rs Updates the configuration test helper.
crates/​cargo-gamma-lib/​src/​commands/​run.rs Simplifies configuration loading and associated tests.
crates/​cargo-gamma-lib/​src/​commands/​list.rs Updates preset-selection tests.
crates/​cargo-gamma-lib/​src/​commands/​dispatch.rs Uses the simplified configuration interface.
crates/​cargo-gamma-lib/​src/​commands/​console_events.rs Aligns multiline warning continuations.
crates/​cargo-gamma-lib/​src/​advise/​analysis.rs Uses total ordering for yield sorting.
crates/​cargo-gamma-lib/​docs/​DESIGN.md Documents campaign evidence, diagnostics, and recovery policies.
crates/​cargo-gamma-lib/​Cargo.toml Adds a test dependency for token normalization.
crates/​cargo-gamma-engine/​src/​schema.rs Preserves block-leading expression grammar.
crates/​cargo-gamma-engine/​src/​ops/​registry/​catalog.rs Registers enum mutators and extends presets.
crates/​cargo-gamma-engine/​src/​ops/​collect/​source_identities.rs Tests cross-file glob identity resolution.
crates/​cargo-gamma-engine/​src/​ops/​collect/​inference_tests.rs Updates expectations for unproven defaults.
crates/​cargo-gamma-engine/​src/​ops/​collect/​definitions.rs Includes composed replacement text in identities.
crates/​cargo-gamma-engine/​src/​ops/​collect/​defaults.rs Strengthens scoped Default evidence.
crates/​cargo-gamma-engine/​src/​ops/​collect/​collector/​types/​coverage_tests.rs Preserves qualified identities despite unrelated globs.
crates/​cargo-gamma-engine/​src/​ops/​collect/​collector/​types.rs Adds enum recognition and stricter default checks.
crates/​cargo-gamma-engine/​src/​ops/​collect/​collector/​temporaries.rs Widens guards for assignments and borrowed temporaries.
crates/​cargo-gamma-engine/​src/​ops/​collect/​collector/​phase_one.rs Tests agreement on value-shadow indexes.
crates/​cargo-gamma-engine/​src/​ops/​collect/​collector/​indexes.rs Tracks lexical value-item shadows.
crates/​cargo-gamma-engine/​src/​ops/​collect/​collector/​enum_semantics.rs Implements enum constructor, variant, and predicate mutations.
crates/​cargo-gamma-engine/​src/​ops/​collect/​collector/​calls.rs Adds conservative missing-method evidence.
crates/​cargo-gamma-engine/​src/​model/​identity.rs Advances mutant identity scheme to version 8.
crates/​cargo-gamma-engine/​src/​cfg.rs Adds guaranteed-presence checks.
crates/​cargo-gamma-engine/​docs/​DESIGN.md Documents discovery and instrumentation contracts.
crates/​cargo-gamma-attrs/​tests/​consumer.rs Tests ordinary execution of annotated tests.
crates/​cargo-gamma-attrs/​src/​lib.rs Exposes and documents #[gamma::ignore].
crates/​cargo-gamma-attrs/​README.md Updates generated attribute guidance.
crates/​cargo-gamma-attrs/​docs/​DESIGN.md Defines mutation-only test-exclusion behavior.
crates/​cargo-gamma-attrs-impl/​src/​lib.rs Exports ignore expansion support.
crates/​cargo-gamma-attrs-impl/​src/​implementation.rs Validates ignore annotations and emits metadata markers.
crates/​cargo-gamma-attrs-impl/​docs/​DESIGN.md Documents ignore arguments and marker encoding.
crates/​cargo-aprz-lib/​src/​reports/​html.rs Uses total ordering for risk sorting.
crates/​cargo-aprz-lib/​src/​facts/​crates/​provider.rs Uses total ordering for suggestion scores.
Cargo.lock Records the added test dependency.

Review effort: Balanced

Comment thread crates/cargo-gamma-attrs/src/lib.rs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Generated replacements use unqualified Default, allowing a shadowing trait in the consumer’s scope to produce a different payload and invalidate the standard-Default proof.

1 open issue
3 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 3, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Constructor replacements use an unqualified Default name, so a shadowing local type can change behavior; fully qualify the standard trait calls and add regression coverage.

1 open issue

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Compiler-exclusion soundness, resumed snapshot integrity, and Windows startup ordering require end-to-end mutation/resume and native Windows validation beyond the supplied in-process fixtures and static review.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.33296% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.4%. Comparing base (38d7f16) to head (f8f9a07).

Files with missing lines Patch % Lines
...o-gamma-engine/src/ops/collect/default_identity.rs 98.6% 5 Missing ⚠️
crates/cargo-gamma-lib/src/exec/testing_state.rs 95.9% 4 Missing ⚠️
...engine/src/ops/collect/collector/enum_semantics.rs 99.0% 2 Missing ⚠️
crates/cargo-gamma-lib/src/exec/test_listing.rs 99.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #342      +/-   ##
========================================
- Coverage   99.5%   99.4%    -0.2%     
========================================
  Files        349     267      -82     
  Lines      62718   50874   -11844     
========================================
- Hits       62423   50583   -11840     
+ Misses       295     291       -4     
Flag Coverage Δ
linux 99.3% <99.3%> (-0.2%) ⬇️
linux-arm 99.3% <99.3%> (-0.2%) ⬇️
scheduled ?
windows 99.4% <99.3%> (-0.2%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The advisory bypasses the existing stack-safety precheck when parsing deeply nested source, and the new Rust doctest disables compilation validation with ignore.

2 open issues

Review effort: Balanced

Comment thread crates/cargo-gamma/src/main.rs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The combined compiler-evidence reuse, Windows startup-ordering, and resumed-snapshot symlink-integrity changes require human review of native CI and runtime-validation evidence beyond this source-only review.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Changes to compiler-evidence compatibility, persisted exclusions, resumed campaign integrity, and Windows pre-main startup require maintainer review and representative campaign/resume and Windows validation before approval.

No open issues 🎉

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The lookup incorrectly borrows a same-named outer struct’s Default evidence for an unbounded generic parameter, allowing continue_to_break without a valid proof.

1 open issue
2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Windows pre-main initialization ordering and compiler-exclusion/snapshot trust-contract changes require platform CI and campaign migration evidence that source inspection alone cannot provide.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The method-absence check ignores function-local extension-trait imports, so it can miss a dependency-provided last method and incorrectly mark owner.first() as eligible for iter.first_to_last.

1 open issue

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical provenance-validation gap grants Default evidence to a foreign type spelled ::std::vec::Vec, enabling constructor and whole-function mutations without the required payload evidence.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review has no active issues that would block approval.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test can falsely report failed termination if the coordinator is delayed, because the descendant proceeds after a fixed sleep without waiting for supervision to start.

1 open issue

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Enum resolution loses absolute-root provenance, causing local core/std shadows to incorrectly reject genuine standard-library variants, retain equivalent mutants, and suppress valid enum mutations.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Mutant-ID scheme 8 and compiler-exclusion proof changes affect persistent campaign semantics, requiring a Gamma maintainer to confirm migration/revalidation invariants and native Windows constructor-ordering CI before approval.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@geeknoid

Copy link
Copy Markdown
Member Author

The latest completed mutation run measured 97.3% (72 survivors and one timeout). Published the follow-up in 1dbe2c6e: focused test oracles for 51 cases, 20 narrowly documented equivalents, and two explicit native-adapter exclusions. New CI is pending; these dispositions are not a measured kill count.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are blocking approval.

No open issues 🎉

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two unresolved issues can retain an equivalent mutant when a renamed extern crate conflicts with a local module and omit a valid mutation candidate when its counterpart method is macro-provided.

2 open issues

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The shadow check misses single-segment paths with generic arguments, causing calls to shadowing generic functions to receive incorrect Ordering-value mutations.

1 open issue
2 resolved since last review

Review effort: Balanced

Extend enum and return-value mutations with source-proven Default identity.
Repair historical compiler-exclusion revalidation and Windows runtime startup.
Improve bounded diagnostics, test filtering, and resumable directory-link snapshots.
Remove gamma::ignore and strengthen mutation regression tests.
Use total ordering for cargo-aprz floating-point report sorting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: af5dec1b-7970-4411-8a3c-c32d8e491236

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues require changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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.

8 participants