23 lines
2.1 KiB
JavaScript
23 lines
2.1 KiB
JavaScript
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import {spawnSync} from 'node:child_process';
|
|
const state=JSON.parse(fs.readFileSync('C:/laragon/data/sgf-tempo/run/modular-regression-current.json','utf8')),tag=process.argv[2];
|
|
if(state.port!==55439||!/^[a-f0-9]{12}$/.test(tag||''))throw Error('Owned QA tag required');
|
|
const root=path.join(state.root,'private/payable-history-'+tag),settings=path.join(root,'settings.json');
|
|
const config=JSON.parse(fs.readFileSync(settings,'utf8'));if(config.tag!==tag||config.cluster!=='sgf_modular_regression_'+state.id)throw Error('Owned QA identity mismatch');
|
|
const volumes=process.argv[3]?process.argv[3].split(',').map(Number):[1000,5000,10000];
|
|
for(const volume of volumes){
|
|
if(![51,1000,5000,10000].includes(volume))throw Error('Unsupported QA volume');
|
|
const calls=[['page-seed',String(volume)],...['legacy','page25','page100'].map(strategy=>['page-bench',strategy])];
|
|
for(const [phase,value] of calls){
|
|
const started=Date.now();const r=spawnSync('C:/laragon/tools/sgf-tempo/php-8.4.27/php.exe',['-d','memory_limit=512M','scripts/payable-history-sgf-proof.php',settings,phase,value],{encoding:'utf8',windowsHide:true,maxBuffer:1024*1024});
|
|
fs.writeFileSync(path.join(root,phase+'-'+volume+'-'+value+'-'+started+'.log'),(r.stdout||'')+(r.stderr||''));
|
|
const expected=path.join(root,phase==='page-seed'?'page-volume.json':`bench-${volume}-${value}.json`);
|
|
if(r.status!==0||!fs.existsSync(expected)||fs.statSync(expected).mtimeMs<started-2000)throw Error('Owned QA load phase failed; private diagnostics at '+root);
|
|
process.stdout.write(r.stdout);
|
|
}
|
|
const read=strategy=>JSON.parse(fs.readFileSync(path.join(root,`bench-${volume}-${strategy}.json`),'utf8'));
|
|
const legacy=read('legacy');for(const size of [25,100]){const current=read('page'+size);if(legacy.position_fingerprints[size]!==current.position_fingerprints[size])throw Error('Financial position parity differs at volume '+volume);}
|
|
console.log(JSON.stringify({volume,financial_position_parity:true,indices_added:false}));
|
|
}
|