Skip to content

Let the AI use Goblin Welder - #11499

Open
liamiak wants to merge 2 commits into
Card-Forge:masterfrom
liamiak:ai-goblin-welder
Open

Let the AI use Goblin Welder#11499
liamiak wants to merge 2 commits into
Card-Forge:masterfrom
liamiak:ai-goblin-welder

Conversation

@liamiak

@liamiak liamiak commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Goblin Welder was AI:RemoveDeck:All. Its ability targets both the artifact that gets sacrificed and
the graveyard card that replaces it, so the two have to be read as one trade. PumpAi read neither —
with no AILogic it fell through to the generic pump targeting, which takes the most expensive
artifact on the battlefield regardless of who owns it.

Three misplays, measured by probing the decision directly (canPlaySa plus the resulting targets):

Board Before
Welder, Chromatic Star, Sol Ring; Wurmcoil Engine in our own graveyard sacrificed the Sol Ring
Welder, Sol Ring; only an Ornithopter in our graveyard still welded — Sol Ring → Ornithopter
Opponent holds the biggest artifact, bomb in their graveyard targeted theirs — sacrificed their Wurmcoil to hand them a Blightsteel Colossus

AILogic$ Weld picks the pair together, delegating each actual choice to something that already
exists:

  • ours, going away — the existing SacCost preference (ComputerUtil.getCardPreference),
    otherwise the cheapest artifact we control. That is what keeps Sol Ring over Chromatic Star, which
    mana value alone cannot separate.
  • theirs, going awaygetBestRemovalTargetAI, since welding against an opponent is removal.
  • coming backpumpMandatoryTarget, already in this class: best from our own graveyard,
    cheapest from theirs.
  • worth doing? — the card returning has to cost more than the one leaving, the test
    ZoneExchangeAi already uses for a swap across zones.
  • timing — the shared AtOppEOT rule, rather than the mid-combat window the generic pump phase
    check happened to allow.

Both branches sit behind the new AILogic, which only this card carries, so nothing else that goes
through PumpAi changes.

Reasoned rather than measured: that welding at the opponent's end step beats acting earlier. The
ability is free and repeatable so holding it costs nothing, but I have not measured a win-rate
difference.

Known limit: it weighs one candidate pair per player rather than every combination, so a swap that a
different artifact of theirs would have justified can be missed.

Full desktop suite: 356 tests, 0 failures. The regression test is the second commit and can be
dropped on its own — two of its cases fail without the fix.

Written with Claude Opus 5 (also recorded in the commit co-authors).

liamiak1 and others added 2 commits August 2, 2026 21:24
The ability targets the artifact that gets sacrificed and the graveyard card that
replaces it, so the two have to be read as one trade. PumpAi read neither: with no
AILogic it fell through to the generic pump targeting, which takes the most
expensive artifact on the battlefield regardless of who owns it.

Measured on a board of Goblin Welder, Chromatic Star and Sol Ring, with a Wurmcoil
Engine in our own graveyard, it sacrificed the Sol Ring. Given only a worse card in
the yard it still welded, trading a Sol Ring for an Ornithopter. And with the
opponent holding the biggest artifact it targeted theirs, sacrificing their Wurmcoil
Engine to hand them the Blightsteel Colossus out of their own graveyard.

AILogic$ Weld picks the pair together. Ours: something already marked expendable
through the existing SacCost preference, otherwise the cheapest artifact we control,
swapped for the best card in our graveyard. An opponent's: their best board artifact
for the worst card in their graveyard, which turns the gift above into removal.
Either way the card coming back has to cost more than the one going away - the test
ZoneExchangeAi already uses for a swap across zones, and half of what
ChangeZoneAi.doSacAndReturnFromGraveLogic uses for sacrifice-and-reanimate.

Timing goes through the shared AtOppEOT rule rather than the mid-combat window the
generic pump phase check happened to allow.

Both branches sit behind the new AILogic, which only this card carries, so nothing
else that goes through PumpAi changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Plays until the AI welds of its own accord at the opponent's end step, and checks
what it chose: our own worst artifact swapped up into the best one in our graveyard,
an opponent's artifact traded down for the junk in theirs, and nothing at all when
the swap gains nothing or the graveyard is worse.

Drop this commit if you would rather not carry the test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants