diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-22 10:56:04 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-22 10:56:04 +0800 |
| commit | 1b0724d62baa3cf5598d374268e7eb09b5dde4b4 (patch) | |
| tree | 02237d752d4fd86bff8da2da7a721fe32e41d8bf /src/LivingVillage.Headless | |
| parent | 53ac3ac3ae373e40edc01d58a697ffc10a079129 (diff) | |
| parent | 593b3a69294f2c93df1e14d4be7d2f4cd9f9ac14 (diff) | |
| download | living-village-1b0724d62baa3cf5598d374268e7eb09b5dde4b4.tar.gz | |
merge: P27 Rumor 长局成本修复(去装箱扫描 + O(1) 裁剪 + rumor-bench)— Hermes 复验通过
Diffstat (limited to 'src/LivingVillage.Headless')
| -rw-r--r-- | src/LivingVillage.Headless/Program.fs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/LivingVillage.Headless/Program.fs b/src/LivingVillage.Headless/Program.fs index 89f4f26..7f5dcf5 100644 --- a/src/LivingVillage.Headless/Program.fs +++ b/src/LivingVillage.Headless/Program.fs @@ -518,6 +518,28 @@ let runCostProbe (ladder: int64 list) : int = Console.Out.Flush() 0 +/// `--rumor-bench [days] [npcs] [chats_per_day]`:Kernel 层 Rumor 长跑基准 +/// (默认 30 NPC × 60 模拟日 × 每日 2000 次聊天)。只读、不改模拟语义。 +let runRumorBench (argv: string[]) : int = + let tryInt64 (index: int) = + if argv.Length > index then + match Int64.TryParse argv.[index] with + | true, value -> Some value + | _ -> None + else None + let days = tryInt64 1 |> Option.defaultValue RumorBench.defaultConfig.Days + let npcs = tryInt64 2 |> Option.defaultValue (int64 RumorBench.defaultConfig.NpcCount) |> int + let chatsPerDay = tryInt64 3 |> Option.defaultValue (int64 RumorBench.defaultConfig.ChatsPerDay) |> int + let config = + { RumorBench.defaultConfig with + Days = days + NpcCount = npcs + ChatsPerDay = chatsPerDay } + let result = RumorBench.run config + printfn "%s" (RumorBench.format result) + Console.Out.Flush() + 0 + let runExisting (argv: string[]) = let rec parse (i: int) @@ -581,7 +603,7 @@ let runExisting (argv: string[]) = if stats.NonFinite > 0L || stats.OutOfBounds > 0L || not replayOk then 1 else 0 | Error msg -> eprintfn $"headless: {msg}" - eprintfn "usage: dotnet run -c Release --project src/LivingVillage.Headless -- --days N --seed S [--npc N] [--dump-relations] [--dump-rumors] [--replay-rumors] | --m5-smoke | --m6a-smoke | --batch K D | --performance-baseline | --cost-probe [D1,D2,...]" + eprintfn "usage: dotnet run -c Release --project src/LivingVillage.Headless -- --days N --seed S [--npc N] [--dump-relations] [--dump-rumors] [--replay-rumors] | --m5-smoke | --m6a-smoke | --batch K D | --performance-baseline | --cost-probe [D1,D2,...] | --rumor-bench [days npcs chats_per_day]" 2 let private parseCostLadder (argv: string[]) : int64 list = @@ -608,5 +630,7 @@ let main argv = LivingVillage.Headless.PerformanceProbe.runDefault () elif argv.Length >= 1 && argv.[0] = "--cost-probe" then runCostProbe (parseCostLadder argv) + elif argv.Length >= 1 && argv.[0] = "--rumor-bench" then + runRumorBench argv else runExisting argv |
