T04: adversarial review round + survey corrections + ADR-0002 (reimplement, assimilate patterns)
This commit is contained in:
parent
a7e31d4210
commit
53c1b18ec1
7 changed files with 414 additions and 94 deletions
|
|
@ -10,6 +10,8 @@ const { Stage } = require('boardgame.io/core');
|
|||
const crypto = require('crypto');
|
||||
|
||||
const NUM_MOVES = parseInt(process.argv[2] || '100000', 10);
|
||||
const DISABLE_UNDO = process.argv.includes('--disable-undo');
|
||||
const SINGLE_RUN = process.argv.includes('--single-run'); // isolated memory measurement
|
||||
const NUM_PLAYERS = 3;
|
||||
|
||||
const SyntheticGround = {
|
||||
|
|
@ -51,7 +53,7 @@ const SyntheticGround = {
|
|||
|
||||
function makeClient(seed) {
|
||||
return Client({
|
||||
game: { ...SyntheticGround, seed },
|
||||
game: { ...SyntheticGround, seed, disableUndo: DISABLE_UNDO },
|
||||
numPlayers: NUM_PLAYERS,
|
||||
playerID: '0',
|
||||
});
|
||||
|
|
@ -89,13 +91,14 @@ function run(seed, numMoves, collectHash) {
|
|||
}
|
||||
|
||||
// --- throughput ---
|
||||
const warm = run(42, Math.min(NUM_MOVES, 5000), false); // warmup/JIT
|
||||
if (!SINGLE_RUN) run(42, Math.min(NUM_MOVES, 5000), false); // warmup/JIT
|
||||
const main = run(42, NUM_MOVES, true);
|
||||
const memAfterMain = process.memoryUsage();
|
||||
|
||||
// --- determinism: same seed twice, different seed once ---
|
||||
const detA = run(7, 4000, true);
|
||||
const detB = run(7, 4000, true);
|
||||
const detC = run(8, 4000, true);
|
||||
const detA = SINGLE_RUN ? {hash: 'skipped'} : run(7, 4000, true);
|
||||
const detB = SINGLE_RUN ? {hash: 'skipped'} : run(7, 4000, true);
|
||||
const detC = SINGLE_RUN ? {hash: 'x'} : run(8, 4000, true);
|
||||
|
||||
// --- memory ---
|
||||
const mem = process.memoryUsage();
|
||||
|
|
@ -112,5 +115,8 @@ const result = {
|
|||
determinism_diff_seed_differs: detA.hash !== detC.hash,
|
||||
rss_mb: Math.round(mem.rss / 1048576),
|
||||
heap_mb: Math.round(mem.heapUsed / 1048576),
|
||||
rss_after_main_mb: Math.round(memAfterMain.rss / 1048576),
|
||||
disable_undo: DISABLE_UNDO,
|
||||
single_run: SINGLE_RUN,
|
||||
};
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
|
|
|
|||
|
|
@ -4,13 +4,68 @@
|
|||
"machine": "bnt-lap001 (WSL2)",
|
||||
"recorded": "2026-07-31",
|
||||
"workload": "synthetic-ground 3p commit/reveal (bench.js)",
|
||||
"runs": [
|
||||
{"applied_moves": 5000, "moves_per_sec": 1930, "elapsed_ms": 2590, "rss_mb": 224},
|
||||
{"applied_moves": 10000, "moves_per_sec": 1605, "elapsed_ms": 6232, "rss_mb": 229},
|
||||
{"applied_moves": 20000, "moves_per_sec": 870, "elapsed_ms": 22978, "rss_mb": 271},
|
||||
{"applied_moves": 100000, "note": "did not finish within 300s; killed"}
|
||||
],
|
||||
"determinism_same_seed": true,
|
||||
"determinism_diff_seed_differs": true,
|
||||
"dependency_stats": {"transitive_packages": 120, "node_modules_size": "37M", "core_package_size": "3.9M"}
|
||||
}
|
||||
"dependency_stats": {
|
||||
"transitive_packages": 120,
|
||||
"node_modules_size": "37M",
|
||||
"core_package_size": "3.9M"
|
||||
},
|
||||
"runs_default_config": [
|
||||
{
|
||||
"applied_moves": 5000,
|
||||
"moves_per_sec": 1930,
|
||||
"elapsed_ms": 2590,
|
||||
"rss_mb": 224
|
||||
},
|
||||
{
|
||||
"applied_moves": 10000,
|
||||
"moves_per_sec": 1605,
|
||||
"elapsed_ms": 6232,
|
||||
"rss_mb": 229
|
||||
},
|
||||
{
|
||||
"applied_moves": 20000,
|
||||
"moves_per_sec": 870,
|
||||
"elapsed_ms": 22978,
|
||||
"rss_mb": 271
|
||||
},
|
||||
{
|
||||
"applied_moves": 100000,
|
||||
"note": "did not finish within 300s; killed"
|
||||
}
|
||||
],
|
||||
"runs_disable_undo": [
|
||||
{
|
||||
"applied_moves": 5000,
|
||||
"moves_per_sec": 1118,
|
||||
"rss_after_main_mb": 100
|
||||
},
|
||||
{
|
||||
"applied_moves": 10000,
|
||||
"moves_per_sec": 1076,
|
||||
"rss_after_main_mb": 132
|
||||
},
|
||||
{
|
||||
"applied_moves": 20000,
|
||||
"moves_per_sec": 942,
|
||||
"rss_after_main_mb": 153
|
||||
},
|
||||
{
|
||||
"applied_moves": 40000,
|
||||
"moves_per_sec": 733,
|
||||
"elapsed_ms": 54595,
|
||||
"rss_after_main_mb": 232
|
||||
},
|
||||
{
|
||||
"applied_moves": 100000,
|
||||
"note": "did not finish within 240s (single-run mode); killed"
|
||||
}
|
||||
],
|
||||
"controls": {
|
||||
"with_undo_5k_recheck_moves_per_sec": 1439,
|
||||
"run_to_run_variance_note": "\u00b125% observed on identical config (1930 vs 1439 @5k with undo)",
|
||||
"updatePlayerID_calls_per_sec": 466508
|
||||
},
|
||||
"revision": "2026-07-31 post-adversarial-review: added disableUndo runs, isolated memory, controls"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue