Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions crates/phase-ai/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,10 @@ pub struct PolicyPenalties {
/// reducer — the discount should be deployed first.
#[serde(default = "default_cost_reduction_defer_penalty")]
pub cost_reduction_defer_penalty: f64,
/// CR 701.9: card-equivalent value of discarding into one active "whenever
/// you discard" engine (preference band, per engine).
#[serde(default = "default_discard_payoff_bonus")]
pub discard_payoff_bonus: f64,
}

impl Default for PolicyPenalties {
Expand Down Expand Up @@ -618,6 +622,7 @@ impl Default for PolicyPenalties {
draw_payoff_bonus: default_draw_payoff_bonus(),
cost_reduction_deploy_bonus: default_cost_reduction_deploy_bonus(),
cost_reduction_defer_penalty: default_cost_reduction_defer_penalty(),
discard_payoff_bonus: default_discard_payoff_bonus(),
}
}
}
Expand Down Expand Up @@ -752,6 +757,9 @@ fn default_cost_reduction_deploy_bonus() -> f64 {
fn default_cost_reduction_defer_penalty() -> f64 {
-0.25
}
fn default_discard_payoff_bonus() -> f64 {
0.6
}
fn default_sacrifice_token_cost() -> f64 {
0.5
}
Expand Down Expand Up @@ -909,6 +917,10 @@ pub const UNTUNED_POLICY_PENALTY_FIELDS: &[(&str, &str)] = &[
"CR 601.2f sequencing nudge for casting past a cheaper unplayed reducer — \
awaiting a paired-seed ai-gate calibration.",
),
(
"discard_payoff_bonus",
"CR 701.9 per-engine discard-payoff weight — awaiting a paired-seed ai-gate calibration.",
),
(
"poison_clock_pressure",
"CR 104.3d win-detector weight — a critical-band term whose magnitude is \
Expand Down
354 changes: 354 additions & 0 deletions crates/phase-ai/src/features/discard_matters.rs

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions crates/phase-ai/src/features/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub mod commitment;
pub mod control;
pub mod cost_reduction;
pub mod devotion;
pub mod discard_matters;
pub mod draw_matters;
pub mod enchantments;
pub mod energy;
Expand All @@ -40,6 +41,7 @@ pub use blink::BlinkFeature;
pub use control::ControlFeature;
pub use cost_reduction::CostReductionFeature;
pub use devotion::DevotionFeature;
pub use discard_matters::DiscardMattersFeature;
pub use draw_matters::DrawMattersFeature;
pub use enchantments::EnchantmentsFeature;
pub use energy::EnergyFeature;
Expand Down Expand Up @@ -98,6 +100,9 @@ pub struct DeckFeatures {
pub graveyard_types: GraveyardTypesFeature,
/// CR 121.1: "whenever you draw" payoff density (draw sources + engines).
pub draw_matters: DrawMattersFeature,
/// CR 701.9: "whenever you discard" payoff density (self-discard outlets +
/// engines). Disjoint from `hand_disruption`, which scores OPPONENT discard.
pub discard_matters: DiscardMattersFeature,
/// Declaration-derived: the deck's declared bracket tier. Unlike the
/// other fields here, this is not structurally detected from card text —
/// it is a per-deck declaration set at deck-analysis time from deck
Expand Down Expand Up @@ -147,6 +152,7 @@ impl DeckFeatures {
poison: poison::detect(deck),
graveyard_types: graveyard_types::detect(deck),
draw_matters: draw_matters::detect(deck),
discard_matters: discard_matters::detect(deck),
bracket_tier: tier,
}
}
Expand Down
Loading
Loading