Skip to content

Match native GBA Spit Up damage and Stockpile consumption - #203

Closed
Roxas2712 wants to merge 27 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-spit-up
Closed

Roxas2712 wants to merge 27 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-spit-up

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 24, 2026 •

Copy link
Copy Markdown

Gen-3 Spit Up currently goes through ordinary damage calculation, multiplying move power and entering ordinary damage/critical hooks. Native execution instead multiplies the calculated base (including its final +2), then applies Helping Hand, STAB and type rounding without critical or damage-variation rolls. Two Stockpile stacks with level 30, equal stats and normal STAB must release 90 rather than the ordinary power-based 87.

Use a dedicated GBA set-damage path and native Stockpile consumption: successful release, Protect and type immunity consume the counter; ordinary misses, semi-invulnerability, sleep and absorption preserve it. Keep owned PP, the three-stack cap and Swallow interaction. Preserve the native set-damage event metadata and clip Substitute hit amounts. Earlier-generation fallback paths remain separate.

Stacked on #198. Review feature commit 8c7df4d relative to f09b570. Canonical public effect writes additionally compose with #121.

Validation:

  • 8,292/8,292 focused checks across FireRed/Emerald: all four user positions and stack counts, actual public choices and native effects, numeric damage, STAB/resistance/immunity/Foresight, low/wide stats, physical and authored special types, Helping Hand, Substitute/Endure, misses/interruption/absorption, screens/burn/weather, selected ability/item/stage combinations, cap/reuse/Swallow, PP and callback counts.
  • Same API-3 consumer and shared fixture against unchanged read-only Gen1Recomp 535a5ec088c1ae1bf4d91dd3e35a56f64cf46d91: 32 isolated workers / 3,974 paired observations pass, including earlier action, target, Follow Me and Helping Hand contracts.
  • Negative control: unchanged Implement native GBA Helping Hand and shared damage modifier #198 fails 770 assertions in the new FireRed cases.
  • Full local quick run: 87/96 engine suites versus 86/95 on clean Implement native GBA Helping Hand and shared damage modifier #198. Exact Counters of all 25 inherited FAIL lines across nine suites match; no additions. SDK 3/3 and B30 pass.
  • Additional composition proof with Map portable move effects and secondary chances to native handlers #121: 14/14 checks load a real mod, patch/read canonical SPIT_UP, perform two actual Stockpile actions and release the expected 90 with owned PP and no ordinary damage/critical callbacks.
  • SPIT_UP_EFFECT revision 1 intentionally changes the fixture fingerprint from 032184f68094e9ca to 397df21576af62f1. Only the move_effects section changes; removing that revision restores the former digest.
  • actionlint and git diff --check pass.

Reproducible runtime: both engines and the contract workflow use JIT-enabled LuaJIT v2.1 a4c064539ea931274d407e1249b4bb575424a0f4. The older local ARM64 2.1.1700008891 VM produces JIT-dependent Thick Fat results in unchanged reference code. Its original failing report is retained, not filtered or claimed green. The maintained pinned VM passes the complete comparison with JIT enabled.

Comparisons use equal stats and synthetic imported-shaped rows. Counters compare each engine's operative operand; the reference's stale legacy Stockpile alias after Protect is not an alias-equality claim. Full ability/item/badge coverage, ordinary damage's remaining order gaps, other set/delayed executors, full RNG traces, called/link controllers, animations and complete gameplay remain separate surfaces. Gen1 stays read-only; no Gen1 source change or publication is required. Hosted CI and combined-fork acceptance are reported separately.

Combined-fork acceptance: integrated into Roxas2712:codex/portability-testing, tested runtime ba2d7d1. All 214/214 engine suites, 3/3 SDK suites and B30 pass with zero FAIL lines. The same 32-worker / 3,974-observation comparison passes on that clean runtime, and the canonical real-mod proof passes 14/14. Integration preserves the existing damage-adjustment argument and updates only the audited effect-section fingerprint pin. Subsequent combined commits only record validation.

Additional runtime check: all new Gen2 Spit Up observations also match the pinned reference when the older local ARM64 VM executes the host alone, on both GBA profiles. The older reference-side JIT divergence remains separately reported.

Hosted CI: all five workflows report action_required pending maintainer approval. The dedicated contract workflow has zero executed jobs. These are separate from local acceptance.

# Conflicts:
#	src/mods/Loader.lua
# Conflicts:
#	docs/modding.md
#	src/mods/Loader.lua
#	src/world/WorldAPI.lua
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