Skip to content

[codex] Reclassify basic land mana backlog bucket - #5089

Merged
matthewevans merged 4 commits into
phase-rs:mainfrom
ntindle:codex/misparse-root29-land-mana-choice
Jul 4, 2026
Merged

[codex] Reclassify basic land mana backlog bucket#5089
matthewevans merged 4 commits into
phase-rs:mainfrom
ntindle:codex/misparse-root29-land-mana-choice

Conversation

@ntindle

@ntindle ntindle commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR now treats root #29 as a backlog false-positive bucket rather than an engine/card-data behavior bug.

Reviewer feedback pointed out that CR 305.6 grants a separate intrinsic mana ability for each basic land type. That means typed duals/triomes should continue to expose separate fixed {T}: Add <color> abilities at the engine/card-data layer, because ability identity and ability_index observe those rows.

The PR therefore removes the invalid root #29 bucket from docs/parser-misparse-backlog.md instead of changing synthesis behavior:

  • 13 typed-land entries are removed from the backlog as not actually misparsed under CR 305.6.
  • The five entries that did not match this bucket's signature in the current export are moved to Other / uncategorized misparse for separate triage.
  • Header totals are updated to match the removed false-positive appearances.

There is no net engine or parser code change against current origin/main.

Validation

  • cargo fmt --all
  • cargo test -p engine --lib basic_land_mana_synthesis_tests passed before the behavior change was reverted.
  • Final local diff check: git diff origin/main -- crates/engine/src/database/synthesis.rs is empty, so no parsed card-data change is expected from this PR.
  • git diff --check passes.

@ntindle
ntindle requested a review from matthewevans as a code owner July 4, 2026 13:42

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors synthesize_basic_land_mana to group multiple basic land subtypes into a single color-choice producer (ManaProduction::AnyOneColor) when multiple subtypes are present, resolving backlog issue 29. It also adds corresponding unit tests and updates the parser misparse backlog documentation. The feedback suggests avoiding a redundant vector allocation by moving the colors vector directly when its length is 1.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread crates/engine/src/database/synthesis.rs Outdated
Comment on lines +467 to +471
let produced = if colors.len() == 1 {
ManaProduction::Fixed {
colors: vec![colors[0]],
contribution: ManaContribution::Base,
}

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.

medium

[MEDIUM] Avoid redundant vector allocation.

Why it matters: When colors.len() == 1, colors is already a Vec<ManaColor> containing exactly one element. We can move it directly instead of allocating a new vector with vec![colors[0]] and dropping the old one.

Suggested fix: Pass colors directly.

    let produced = if colors.len() == 1 {
        ManaProduction::Fixed {
            colors,
            contribution: ManaContribution::Base,
        }
    }

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

Parse changes introduced by this PR · 86 card(s), 24 signature(s) (baseline: main 1badc1920dab)

37 card(s) · ability/Mana · removed: Mana (kind=activated, mana={G})

Examples: Arctic Treeline, Bayou, Breeding Pool (+34 more)

29 card(s) · ability/Mana · removed: Mana (kind=activated, mana={R})

Examples: Alpine Meadow, Badlands, Blood Crypt (+26 more)

20 card(s) · ability/Mana · removed: Mana (kind=activated, mana={B})

Examples: Contaminated Aquifer, Eclipsed Steppe, Fetid Pools (+17 more)

10 card(s) · ability/Mana · removed: Mana (kind=activated, mana={U})

Examples: Glacial Floodplain, Hallowed Fountain, Idyllic Beachfront (+7 more)

8 card(s) · ability/Mana · field mana: {B}1 of {B}{G}

Examples: Bayou, Festering Thicket, Haunted Mire (+5 more)

8 card(s) · ability/Mana · field mana: {U}1 of {U}{G}

Examples: Breeding Pool, Hedge Maze, Rain-Slicked Copse (+5 more)

8 card(s) · ability/Mana · field mana: {U}1 of {U}{R}

Examples: Coastal Peak, Molten Tributary, Scorched Geyser (+5 more)

8 card(s) · ability/Mana · field mana: {W}1 of {W}{B}

Examples: Eclipsed Steppe, Godless Shrine, Scrubland (+5 more)

8 card(s) · ability/Mana · field mana: {W}1 of {W}{G}

Examples: Arctic Treeline, Canopy Vista, Fetching Garden (+5 more)

8 card(s) · ability/Mana · field mana: {W}1 of {W}{R}

Examples: Alpine Meadow, Elegant Parlor, Glittering Massif (+5 more)

7 card(s) · ability/Mana · field mana: {B}1 of {B}{R}

Examples: Badlands, Blood Crypt, Canyon Slough (+4 more)

7 card(s) · ability/Mana · field mana: {R}1 of {R}{G}

Examples: Cinder Glade, Commercial District, Highland Forest (+4 more)

7 card(s) · ability/Mana · field mana: {U}1 of {U}{B}

Examples: Contaminated Aquifer, Fetid Pools, Ice Tunnel (+4 more)

7 card(s) · ability/Mana · field mana: {W}1 of {W}{U}

Examples: Glacial Floodplain, Hallowed Fountain, Idyllic Beachfront (+4 more)

1 card(s) · ability/Mana · field mana: {B}1 of {B}{R}{G}

Examples: Ziatora's Proving Ground

1 card(s) · ability/Mana · field mana: {U}1 of {U}{B}{G}

Examples: Zagoth Triome

1 card(s) · ability/Mana · field mana: {U}1 of {U}{B}{R}

Examples: Xander's Lounge

1 card(s) · ability/Mana · field mana: {U}1 of {U}{R}{G}

Examples: Ketria Triome

1 card(s) · ability/Mana · field mana: {W}1 of {W}{B}{G}

Examples: Indatha Triome

1 card(s) · ability/Mana · field mana: {W}1 of {W}{B}{R}

Examples: Savai Triome

1 card(s) · ability/Mana · field mana: {W}1 of {W}{R}{G}

Examples: Jetmir's Garden

1 card(s) · ability/Mana · field mana: {W}1 of {W}{U}{B}

Examples: Raffine's Tower

1 card(s) · ability/Mana · field mana: {W}1 of {W}{U}{G}

Examples: Spara's Headquarters

1 card(s) · ability/Mana · field mana: {W}1 of {W}{U}{R}

Examples: Raugrin Triome

1 card(s) had Oracle-text changes (errata/reprint) — excluded as non-parser.

@matthewevans matthewevans self-assigned this Jul 4, 2026

@matthewevans matthewevans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[HIGH] Multi-basic lands are collapsed into one choice ability, but CR 305.6 grants one intrinsic ability per basic land type. Evidence: crates/engine/src/database/synthesis.rs now emits a single ManaProduction::AnyOneColor when colors.len() > 1, while existing engine code documents and tests the CR 305.6 model as separate intrinsic abilities: crates/engine/src/game/effects/effect.rs checks that a land gaining all basic land types gets one fixed tap ability for each color, and crates/engine/src/game/engine.rs treats dual lands/triomes as lands with multiple mana options selected by ability_index. Why it matters: card-data support for 86 typed lands would be marked fixed while changing the ability identity/count the engine exposes for dual lands and triomes; this is not just presentation, because ability indexing and ability inspection observe those abilities. Suggested fix: keep one synthesized {T}: Add <color> ability per basic land type at the engine/card-data ability layer, and solve the root #29 export/UI grouping at the consumer/display or mana-option normalization seam if duplicate same-cost options need to be presented as a color choice.

@matthewevans matthewevans removed their assignment Jul 4, 2026
@ntindle ntindle changed the title [codex] Fix synthesized basic land color choices [codex] Reclassify basic land mana backlog bucket Jul 4, 2026
@matthewevans matthewevans self-assigned this Jul 4, 2026

@matthewevans matthewevans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved current head. This now keeps CR 305.6 behavior intact at the engine/card-data layer and limits the PR to removing the invalid backlog bucket / moving the remaining non-matching cards to uncategorized triage. The current local diff has no synthesis or parser code changes, so auto-merge can wait for required checks.

@matthewevans matthewevans added the refactor Refactor label Jul 4, 2026
@matthewevans
matthewevans enabled auto-merge July 4, 2026 14:08
@matthewevans matthewevans removed their assignment Jul 4, 2026
@matthewevans
matthewevans added this pull request to the merge queue Jul 4, 2026
Merged via the queue into phase-rs:main with commit 63571d2 Jul 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants