Add game-simulation package with multi-run balance testing, fix stalled-pipeline trap
Adds a full simulation harness (game-simulation package) with greedy/random strategies, 36-metric diagnostics, multi-run orchestration via child processes, and a statistical interpreter. Includes 2.3x engine performance optimizations (research bonus caching, per-DC dirty tracking, reduced allocations in tick pipeline, single-pass loops). Fixes a critical balance bug where training pipelines stalled on insufficient VRAM would permanently block training slots — the engine never re-checked stalled pipelines, and the greedy strategy didn't pre-check VRAM requirements. This caused 20-25% of seeds to get stuck in Scale-up era. All three fixes (engine un-stalling, strategy VRAM pre-check, stalled pipeline cancellation) bring pass rate from 75% to 100% across 20 random seeds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,7 @@ export const CAPABILITY_FORMULA = {
|
||||
efficiencyWeight: 0.1,
|
||||
};
|
||||
|
||||
export const PRETRAINING_BASE_TICKS = 180;
|
||||
export const PRETRAINING_BASE_TICKS = 90;
|
||||
export const SFT_TIME_FRACTION = 0.10;
|
||||
export const SFT_COMPUTE_FRACTION = 0.06;
|
||||
export const ALIGNMENT_TIME_FRACTION = 0.08;
|
||||
@@ -97,12 +97,12 @@ export const SFT_SPECIALIZATION_BONUSES: Record<string, Record<string, number>>
|
||||
'tool-use': { reasoning: 0, coding: 8, creative: 0, math: 0, knowledge: 0, multimodal: 0, agents: 15, speed: -5, contextUtilization: 0 },
|
||||
};
|
||||
|
||||
export const CONSUMER_BASE_GROWTH = 0.002;
|
||||
export const CONSUMER_BASE_GROWTH = 0.005;
|
||||
export const CONSUMER_QUALITY_GROWTH_MULTIPLIER = 0.01;
|
||||
export const CONSUMER_PRICE_ELASTICITY = -0.5;
|
||||
export const CONSUMER_BASE_CHURN = 0.001;
|
||||
|
||||
export const CONSUMER_TOKENS_PER_SUBSCRIBER = 0.5;
|
||||
export const CONSUMER_TOKENS_PER_SUBSCRIBER = 2.0;
|
||||
|
||||
export const API_TOKENS_PER_REQUEST = 500;
|
||||
export const API_REVENUE_PER_MTOK = 1.0;
|
||||
@@ -149,9 +149,9 @@ export const BASE_LATENCY_MS = 50;
|
||||
export const QUEUE_LATENCY_MS_PER_PERCENT = 5;
|
||||
|
||||
export const ERA_THRESHOLDS = {
|
||||
scaleup: { revenue: 10_000, capability: 15, reputation: 30 },
|
||||
bigtech: { revenue: 1_000_000, capability: 50, reputation: 60 },
|
||||
agi: { revenue: 100_000_000, capability: 90, reputation: 70 },
|
||||
scaleup: { revenue: 5_000, capability: 10, reputation: 40 },
|
||||
bigtech: { revenue: 10_000_000, capability: 55, reputation: 65 },
|
||||
agi: { revenue: 1_000_000_000, capability: 93, reputation: 80 },
|
||||
};
|
||||
|
||||
// --- Data Center Tier Configs ---
|
||||
@@ -162,12 +162,12 @@ export const DC_TIER_CONFIGS: Record<DCTier, DCTierConfig> = {
|
||||
name: 'Small Data Center',
|
||||
rackSlots: 200,
|
||||
powerBudgetKW: 1_000,
|
||||
baseCost: 500_000,
|
||||
baseCost: 250_000,
|
||||
buildTimeTicks: 600,
|
||||
firstBuildTimeTicks: 30,
|
||||
firstBuildTimeTicks: 20,
|
||||
requiredEra: 'startup',
|
||||
requiredResearch: null,
|
||||
baseEnergyCostPerTick: 50,
|
||||
baseEnergyCostPerTick: 15,
|
||||
},
|
||||
medium: {
|
||||
tier: 'medium',
|
||||
@@ -392,7 +392,7 @@ export const RACK_SKU_CONFIGS: Record<RackSkuId, RackSkuConfig> = {
|
||||
powerDrawKW: 0.4,
|
||||
baseCost: 3_200,
|
||||
requiredResearch: [],
|
||||
pipelineTimeTicks: { manufacturing: 20, receiving: 10, installation: 15, testing: 15 },
|
||||
pipelineTimeTicks: { manufacturing: 15, receiving: 8, installation: 10, testing: 10 },
|
||||
testFailureRate: 0.05,
|
||||
productionFailureRate: 0.0002,
|
||||
repairCostFraction: 0.10,
|
||||
@@ -414,7 +414,7 @@ export const RACK_SKU_CONFIGS: Record<RackSkuId, RackSkuConfig> = {
|
||||
powerDrawKW: 0.5,
|
||||
baseCost: 12_000,
|
||||
requiredResearch: [],
|
||||
pipelineTimeTicks: { manufacturing: 30, receiving: 15, installation: 25, testing: 20 },
|
||||
pipelineTimeTicks: { manufacturing: 20, receiving: 10, installation: 15, testing: 15 },
|
||||
testFailureRate: 0.07,
|
||||
productionFailureRate: 0.0003,
|
||||
repairCostFraction: 0.12,
|
||||
@@ -436,7 +436,7 @@ export const RACK_SKU_CONFIGS: Record<RackSkuId, RackSkuConfig> = {
|
||||
powerDrawKW: 1.0,
|
||||
baseCost: 22_000,
|
||||
requiredResearch: [],
|
||||
pipelineTimeTicks: { manufacturing: 40, receiving: 20, installation: 30, testing: 30 },
|
||||
pipelineTimeTicks: { manufacturing: 25, receiving: 12, installation: 20, testing: 18 },
|
||||
testFailureRate: 0.08,
|
||||
productionFailureRate: 0.0003,
|
||||
repairCostFraction: 0.12,
|
||||
@@ -801,8 +801,8 @@ export const DC_UPGRADE_INCREMENT = 0.1;
|
||||
export const COHORT_SCALE_FACTOR = 0.0003;
|
||||
|
||||
export const FUNDING_ROUNDS = {
|
||||
seed: { amount: 500_000, dilution: 0.10, requirements: { minRevenue: 500, minUsers: 0, minReputation: 0 } },
|
||||
seriesA: { amount: 2_000_000, dilution: 0.15, requirements: { minRevenue: 2_500, minUsers: 100, minReputation: 20 } },
|
||||
seed: { amount: 500_000, dilution: 0.10, requirements: { minRevenue: 100, minUsers: 0, minReputation: 0 } },
|
||||
seriesA: { amount: 2_000_000, dilution: 0.15, requirements: { minRevenue: 1_000, minUsers: 50, minReputation: 20 } },
|
||||
seriesB: { amount: 10_000_000, dilution: 0.12, requirements: { minRevenue: 25_000, minUsers: 1_000, minReputation: 30 } },
|
||||
seriesC: { amount: 50_000_000, dilution: 0.10, requirements: { minRevenue: 250_000, minUsers: 10_000, minReputation: 40 } },
|
||||
seriesD: { amount: 200_000_000, dilution: 0.08, requirements: { minRevenue: 2_500_000, minUsers: 50_000, minReputation: 50 } },
|
||||
@@ -818,6 +818,9 @@ export const REGULATION_COMPLIANCE_PER_CAPABILITY = 50;
|
||||
export const SAFETY_INCIDENT_PROBABILITY_BASE = 0.0002;
|
||||
export const SAFETY_INCIDENT_REPUTATION_HIT = 15;
|
||||
export const LOW_SAFETY_THRESHOLD = 40;
|
||||
export const MODEL_BASE_SAFETY = 40;
|
||||
export const SAFETY_RECORD_RECOVERY_RATE = 0.02;
|
||||
export const PUBLIC_PERCEPTION_GROWTH_RATE = 0.3;
|
||||
|
||||
// ========================================================================
|
||||
// MARKET SYSTEM v2 — Shared TAM, Tiered Products, Enterprise Pipeline
|
||||
@@ -826,14 +829,14 @@ export const LOW_SAFETY_THRESHOLD = 40;
|
||||
// --- Shared TAM ---
|
||||
|
||||
export const TAM_BASE_SIZES: Record<Era, Record<TAMSegmentId, number>> = {
|
||||
startup: { consumer: 50_000, developer: 5_000, enterprise: 500, government: 50 },
|
||||
startup: { consumer: 200_000, developer: 20_000, enterprise: 500, government: 50 },
|
||||
scaleup: { consumer: 5_000_000, developer: 200_000, enterprise: 5_000, government: 500 },
|
||||
bigtech: { consumer: 50_000_000, developer: 2_000_000, enterprise: 50_000, government: 5_000 },
|
||||
agi: { consumer: 500_000_000, developer: 20_000_000, enterprise: 200_000, government: 20_000 },
|
||||
};
|
||||
export const TAM_GROWTH_PER_TICK = 0.0001;
|
||||
export const TAM_GROWTH_PER_TICK = 0.0003;
|
||||
export const SHARE_TEMPERATURE = 4.0;
|
||||
export const SHARE_MIGRATION_SPEED = 0.03;
|
||||
export const SHARE_MIGRATION_SPEED = 0.05;
|
||||
|
||||
// --- Attractiveness Weights ---
|
||||
|
||||
@@ -856,7 +859,7 @@ export const CONSUMER_TIER_DEFAULTS: Record<ConsumerTierId, { price: number; tok
|
||||
export const CONSUMER_TIER_ORDER: ConsumerTierId[] = ['free', 'plus', 'pro', 'team'];
|
||||
|
||||
export const CONVERSION_RATES: Record<string, number> = {
|
||||
'free->plus': 0.002,
|
||||
'free->plus': 0.008,
|
||||
'plus->pro': 0.0008,
|
||||
'pro->team': 0.0003,
|
||||
};
|
||||
@@ -868,7 +871,7 @@ export const TIER_CHURN_RATES: Record<ConsumerTierId, number> = {
|
||||
team: 0.0004,
|
||||
};
|
||||
|
||||
export const FREE_TIER_ADOPTION_RATE = 0.05;
|
||||
export const FREE_TIER_ADOPTION_RATE = 0.10;
|
||||
|
||||
// --- API Tier Defaults ---
|
||||
|
||||
@@ -889,14 +892,14 @@ export const API_TIER_CHURN_RATES: Record<ApiTierId, number> = {
|
||||
};
|
||||
|
||||
export const API_CONVERSION_RATES: Record<string, number> = {
|
||||
'free->payg': 0.003,
|
||||
'free->payg': 0.010,
|
||||
'payg->scale': 0.001,
|
||||
'scale->enterprise-api': 0.0004,
|
||||
};
|
||||
|
||||
export const API_TOKENS_PER_DEVELOPER_PER_TICK: Record<ApiTierId, number> = {
|
||||
free: 0.5,
|
||||
payg: 5,
|
||||
free: 1.0,
|
||||
payg: 10,
|
||||
scale: 50,
|
||||
'enterprise-api': 200,
|
||||
};
|
||||
@@ -917,7 +920,7 @@ export const AGENTS_PLATFORM_CHURN_RATE = 0.0005;
|
||||
|
||||
// --- Enterprise Pipeline ---
|
||||
|
||||
export const BASE_LEAD_RATE = 0.005;
|
||||
export const BASE_LEAD_RATE = 0.02;
|
||||
export const LEAD_EXPIRY_TICKS = 600;
|
||||
|
||||
export const PIPELINE_STAGE_TIMEOUTS: Record<EnterprisePipelineStage, number> = {
|
||||
@@ -928,10 +931,10 @@ export const PIPELINE_STAGE_TIMEOUTS: Record<EnterprisePipelineStage, number> =
|
||||
};
|
||||
|
||||
export const PIPELINE_TRANSITION_RATES: Record<string, number> = {
|
||||
'lead->qualification': 0.02,
|
||||
'qualification->poc': 0.015,
|
||||
'poc->negotiation': 0.01,
|
||||
'negotiation->active': 0.008,
|
||||
'lead->qualification': 0.04,
|
||||
'qualification->poc': 0.03,
|
||||
'poc->negotiation': 0.02,
|
||||
'negotiation->active': 0.015,
|
||||
};
|
||||
|
||||
export const SLA_PENALTY_FRACTION = 0.02;
|
||||
@@ -974,7 +977,7 @@ export const CONTRACT_DURATION_BY_SEGMENT: Record<EnterpriseSegment, number> = {
|
||||
|
||||
// --- Developer Ecosystem ---
|
||||
|
||||
export const BASE_DEV_GROWTH = 0.001;
|
||||
export const BASE_DEV_GROWTH = 0.003;
|
||||
export const FREE_TIER_DEV_MULTIPLIER = 0.0005;
|
||||
export const OPEN_SOURCE_DEV_BOOST = 0.05;
|
||||
export const DEV_REL_EFFECTIVENESS = 0.00001;
|
||||
|
||||
@@ -41,7 +41,7 @@ export const INITIAL_TALENT: TalentState = {
|
||||
research: { id: 'research', headcount: 2, budget: 5_000, effectiveness: 0.5, morale: 0.8 },
|
||||
engineering: { id: 'engineering', headcount: 3, budget: 7_000, effectiveness: 0.5, morale: 0.8 },
|
||||
operations: { id: 'operations', headcount: 1, budget: 3_000, effectiveness: 0.5, morale: 0.8 },
|
||||
sales: { id: 'sales', headcount: 0, budget: 0, effectiveness: 0, morale: 0.8 },
|
||||
sales: { id: 'sales', headcount: 0, budget: 0, effectiveness: 0.5, morale: 0.8 },
|
||||
},
|
||||
keyHires: [],
|
||||
hiringPipeline: [],
|
||||
|
||||
Reference in New Issue
Block a user