publish
This commit is contained in:
parent
01204dfa2f
commit
f5fc9b76ce
73 changed files with 32628 additions and 376 deletions
13
experiments/ab/variant_check.mjs
Normal file
13
experiments/ab/variant_check.mjs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import fs from 'node:fs/promises';
|
||||
import vm from 'node:vm';
|
||||
for (const file of process.argv.slice(2)) {
|
||||
const html=await fs.readFile(file,'utf8');
|
||||
const scripts=[...html.matchAll(/<script[^>]*>([\s\S]*?)<\/script>/g)].map(m=>m[1]);
|
||||
if(scripts.length!==2) throw new Error(file+': expected 2 scripts, got '+scripts.length);
|
||||
for(const s of scripts)new vm.Script(s);
|
||||
const kc={}; vm.runInNewContext(scripts[0],kc);
|
||||
const kernels=kc.MANDEL_WEBGPU_KERNELS;
|
||||
if(!kernels||Object.keys(kernels).length!==20)throw new Error(file+': kernel bundle malformed');
|
||||
for(const k of ['DIRECT_F32_WGSL','FAST_PERTURB_WGSL','UNKNOWN_STATS_WGSL','COLOR_WGSL'])if(typeof kernels[k]!=='string')throw new Error(file+': missing '+k);
|
||||
console.log('PASS',file.split('/').at(-1),'JS syntax, 19 WGSL kernels + version');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue