In this section
- Review2 Check render · globalgrid2050 / testcode/202609142202/proof/review2_check.mjs lines 1–121
- Review2b Check render · globalgrid2050 / testcode/202609142202/proof/review2b_check.mjs lines 1–68
- Verify 1 render · globalgrid2050 / testcode/202609142202/proof/verify-1.mjs lines 1–156
- Verify 1b render · globalgrid2050 / testcode/202609142202/proof/verify-1b.mjs lines 1–80
- Verify 2 render · globalgrid2050 / testcode/202609142202/proof/verify-2.mjs lines 1–208
Review2 Check
A JavaScript module in the proof folder of GlobalGrid2050 that draws review2 report and cables, using SHA-256.
renderglobalgrid2050 / testcode/202609142202/proof/review2_check.mjs · lines 1–121 of 121 · version 2026-09-14 22:02 · Not reached from any entry point (candidate for review) · pattern metrics (shared by 6 files)
- What it does
- It draws review2 report and cables. Defines 7 functions or classes, including sleep, newPage, hud, hudFind, st. Uses libraries node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: cables.
- Inputs & outputs
- Out: JSON file review2_report.json; WebGL/WebGPU drawing.
- What it achieves
- It is built from the sleep step (`sleep`), the new page helper (`newPage`) and the hud step (`hud`). Adversarial review round 2 — headless probe (puppeteer-core by absolute path, GPU flags as instructed). It writes `review2_report.json`.
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · testcode/202609142202/proof · JavaScript module
- Uses
- GlobalGrid2050 Build News Feed V9 5 1 (script call), node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core
- Used by
- none found
- Produces
- sleep, newPage, hud, hudFind, st, metrics, w
- Defines here
- sleep, newPage, hud, hudFind, st, metrics, w
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609142202/proof/review2_check.mjs:1-121 · blob 34de2dc2a88d77002d4f910a56a7c6aff8e75fe2 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
// Adversarial review round 2 — headless probe (puppeteer-core by absolute path, GPU flags as instructed).
// Starts its own python http.server on PORT from the repository root, stops it with taskkill /T /F.
// Every non-127.0.0.1 request is LOGGED. In the forged-bucket test the bucket and raw.githubusercontent URLs are
// intercepted and answered LOCALLY (request.respond) so nothing leaves the machine; the log says which.
import { createRequire } from 'node:module';
import fs from 'node:fs';
import { spawn, execSync } from 'node:child_process';
const require = createRequire(import.meta.url);
const puppeteer = require('C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core');
const PORT = '8871';
const ROOT = 'C:/Users/vikra/Documents/GitHub/globalgrid2050';
const URL = `http://127.0.0.1:${PORT}/testcode/202609142202/index.html`;
const OUT = 'C:/Users/vikra/Documents/GitHub/globalgrid2050/testcode/202609142202/proof/';
const sleep = ms => new Promise(r => setTimeout(r, ms));
const R = { url: URL, started_utc: new Date().toISOString() };
const server = spawn('python', ['-m', 'http.server', PORT, '--bind', '127.0.0.1'], { cwd: ROOT, stdio: ['ignore', fs.openSync(OUT + 'review2_server.log', 'w'), fs.openSync(OUT + 'review2_server.log', 'a')] });
await sleep(1500);
const browser = await puppeteer.launch({
headless: 'new', executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
args: ['--enable-gpu', '--use-gl=angle', '--use-angle=d3d11', '--ignore-gpu-blocklist', '--enable-unsafe-webgpu', '--no-sandbox', '--window-size=1440,1000', '--enable-precise-memory-info']
});
async function newPage(w, h, dpr, mobile) {
const page = await browser.newPage(); const ext = [], errors = [];
page.on('request', req => { const u = req.url(); if (!u.startsWith('http://127.0.0.1')) ext.push({ url: u, t: Date.now() }); });
page.on('pageerror', e => errors.push('pageerror: ' + e.message));
page.on('console', m => { const t = m.type(); if (t === 'error' || t === 'warning') errors.push(t + ': ' + m.text()); });
await page.setViewport({ width: w, height: h, deviceScaleFactor: dpr, isMobile: mobile, hasTouch: mobile });
return { page, ext, errors };
}
const hud = page => page.evaluate(() => Array.from(document.querySelectorAll('#hud div')).map(d => d.textContent));
const hudFind = async (page, re) => (await hud(page)).find(t => re.test(t)) || null;
const st = page => page.evaluate(() => { const S = window.__qts.S; return { theta: S.theta, outcome: S.outcome, born: S.born || null, msg: S.msg, hold: !!S.hold, phi: S.phi, hist: Object.fromEntries(S.hist), measurements: S.measurements.length, lastQuery: S.lastQuery }; });
const metrics = async (cdp) => { try { await cdp.send('HeapProfiler.collectGarbage'); } catch (e) { } const m = await cdp.send('Performance.getMetrics'); const o = {}; for (const x of m.metrics) if (['JSHeapUsedSize', 'JSHeapTotalSize', 'Nodes', 'JSEventListeners', 'ScriptDuration', 'TaskDuration', 'Timestamp'].includes(x.name)) o[x.name] = x.value; return o; };
try {
const { page, ext, errors } = await newPage(1440, 1000, 1, false);
const cdp = await page.target().createCDPSession(); await cdp.send('Performance.enable'); await cdp.send('HeapProfiler.enable');
await page.goto(URL, { waitUntil: 'networkidle0', timeout: 120000 }); await sleep(5000);
const d = R.desktop = {};
d.hudAtLoad = await hud(page);
d.externalDuringLoad = ext.map(e => e.url);
// ---- T2: per-frame GPU traffic and draw shape over 3 s idle ----
d.glTraffic = await page.evaluate(() => new Promise(res => {
const gl = document.querySelector('#gl').getContext('webgl2'); const { S } = window.__qts;
const c = { bufferData: 0, bufferSubData: 0, texImage2D: 0, texSubImage2D: 0, readPixels: 0, frames: 0, seaDraws: 0, seaDrawShapes: new Set(), otherInstanced: 0, drawArrays: 0 };
const w = (n) => { const o = gl[n]; gl[n] = function (...a) { c[n]++; return o.apply(gl, a); }; return () => { gl[n] = o; }; };
const restores = ['bufferData', 'bufferSubData', 'texImage2D', 'texSubImage2D', 'readPixels', 'drawArrays'].map(w);
const odi = gl.drawArraysInstanced; gl.drawArraysInstanced = function (m, f, n, i) { if (n === S.seaDrawn) { c.seaDraws++; c.seaDrawShapes.add([m, f, n, i].join(',')); } else c.otherInstanced++; return odi.call(gl, m, f, n, i); };
let raf; const tick = () => { c.frames++; raf = requestAnimationFrame(tick); }; raf = requestAnimationFrame(tick);
setTimeout(() => { cancelAnimationFrame(raf); restores.forEach(r => r()); gl.drawArraysInstanced = odi; c.seaDrawShapes = [...c.seaDrawShapes]; res(c); }, 3000);
}));
// ---- T2b: JS CPU share over 10 s idle (CDP ScriptDuration / wall) ----
{ const a = await metrics(cdp); await sleep(10000); const b = await metrics(cdp); d.idleCpu = { seconds: b.Timestamp - a.Timestamp, scriptSeconds: b.ScriptDuration - a.ScriptDuration, taskSeconds: b.TaskDuration - a.TaskDuration, scriptShare: (b.ScriptDuration - a.ScriptDuration) / (b.Timestamp - a.Timestamp) }; }
// ---- T3: heap / DOM over time ----
d.heap = { t0_afterLoad: await metrics(cdp) };
await sleep(45000); d.heap.t1_after45sIdle = await metrics(cdp);
for (let i = 0; i < 150; i++) { await page.click('#reprepare'); await sleep(15); await page.click('#measure'); await sleep(15); }
await sleep(1000); d.heap.t2_after150measurements = await metrics(cdp); d.heap.measurementsRecorded = (await st(page)).measurements; d.heap.recordChips = await page.evaluate(() => document.querySelectorAll('#record button').length);
await sleep(30000); d.heap.t3_after30sMoreIdle = await metrics(cdp);
d.heap.fpsLine = await hudFind(page, /^fps/);
d.externalAfterHeapTests = ext.length;
// ---- T4: failed search then Enter ----
await page.click('#reprepare'); await sleep(100);
const before4 = await st(page);
await page.evaluate(() => { document.querySelector('#search').value = ''; }); await page.click('#search'); await page.type('#search', '#999999999'); await page.keyboard.press('Enter'); await sleep(200);
const mid4 = await st(page); await page.keyboard.press('Enter'); await sleep(300); const after4 = await st(page);
d.failedSearchThenEnter = { firstEnterMsg: mid4.msg, lastQueryAfterFirstEnter: mid4.lastQuery, measuredOnSecondEnter: after4.outcome >= 0 && after4.measurements > before4.measurements, outcomeAfter: after4.outcome, bornAfter: after4.born, measurementsBefore: before4.measurements, measurementsAfter: after4.measurements };
// ---- T5: Enter while a button has keyboard focus ----
await page.click('#reprepare'); await sleep(100); const before5 = await st(page);
await page.focus('#hold'); await page.keyboard.press('Enter'); await sleep(300); const after5 = await st(page);
d.enterOnHoldButton = { measurementsBefore: before5.measurements, measurementsAfter: after5.measurements, measured: after5.measurements > before5.measurements, holdBefore: before5.hold, holdAfter: after5.hold };
if (after5.hold) { await page.click('#hold'); await sleep(50); }
// ---- T6: φ text after collapse ----
await page.click('#reprepare'); await sleep(100); await page.click('#measure'); await sleep(300);
{ const p1 = (await st(page)).phi; await sleep(1000); const p2 = (await st(page)).phi; d.phiAfterCollapse = { phi_t0: p1, phi_t1s: p2, phiChanged: p1 !== p2, stateLine: await hudFind(page, /^state/) }; }
// ---- T12: record chip re-steer: join line present? ----
{ await page.click('#record button'); await sleep(200); d.chipResteer = { joinLine: await hudFind(page, /^join/), famJoinNote: await page.evaluate(() => window.__qts.S.famJoinNote), msg: await page.evaluate(() => window.__qts.S.msg) }; }
// ---- T11: atom with maker AND stars edges: #15 renderStats ----
{ await page.evaluate(() => { document.querySelector('#search').value = ''; }); await page.click('#search'); await page.type('#search', '#15'); await page.keyboard.press('Enter'); await sleep(300);
d.atom15 = await page.evaluate(() => { const { S, D } = window.__qts; const eds = D.random.edges.filter(ed => /^#15\s/.test(ed.from) || /^#15\s/.test(ed.to)); return { focus: S.atom && S.atom.n + ' ' + S.atom.name, tier: S.twin.tier, tierLabel: S.twin.tierLabel, candidates: S.twin.all.length, edgesTouching15: eds.length, edgesWithP: eds.filter(e => e.p != null).length, edgesWithoutP: eds.filte … [line shortened here: 433 characters; full line on GitHub]
d.atom15.hudTwinLine = await hudFind(page, /^twin/); }
d.externalBeforeForgedBucket = ext.length;
// ---- T7: forged bucket (answered locally) — does the page show numbers / line text from a sha256-mismatched record? ----
await page.evaluate(() => { document.querySelector('#search').value = ''; }); await page.click('#search'); await page.type('#search', 'Number'); await page.keyboard.press('Enter'); await sleep(300);
const intercepted = [];
await page.setRequestInterception(true);
page.on('request', req => {
const u = req.url();
if (u.startsWith('http://127.0.0.1')) return req.continue();
if (/\/code\/f\/12\.json/.test(u)) { intercepted.push({ url: u, answered: 'locally with a forged bucket' }); return req.respond({ status: 200, contentType: 'application/json', body: JSON.stringify({ '6076': { n: 6076, names: ['Number'], lines: [1, 2, 3], repos: ['forged-a', 'forged-b', 'forged-c'], places: [{ repo: 'Ventusltd/globalgrid2050', commit: '1a382b71b99cdf3592f15024aabab244ba6fc31e', … [line shortened here: 478 characters; full line on GitHub]
if (/raw\.githubusercontent\.com/.test(u)) { intercepted.push({ url: u, answered: 'locally with dummy text' }); return req.respond({ status: 200, contentType: 'text/plain', body: Array.from({ length: 120 }, (_, i) => `DUMMY LINE ${i + 1} (answered locally by the review probe, not GitHub)`).join('\n') }); }
intercepted.push({ url: u, answered: 'ABORTED' }); return req.abort();
});
await page.click('#cable'); await sleep(100); await page.click('#reprepare'); await sleep(100); await page.click('#measure'); await sleep(2500);
d.forgedBucket = { cableLine: await hudFind(page, /^cable/), liveRec: await page.evaluate(() => window.__qts.S.liveRec && { n: window.__qts.S.liveRec.n, lines: window.__qts.S.liveRec.rec.lines.length, repos: window.__qts.S.liveRec.rec.repos.length }) };
const btn = await page.$('#lines button.u-chip'); if (btn) { await btn.click(); await sleep(2500); d.forgedBucket.lineText = { note: await page.evaluate(() => { const n = document.querySelector('#lines .u-code .u-muted'); return n ? n.textContent : null; }), linesShown: await page.evaluate(() => document.querySelectorAll('#lines .u-line').length), firstLine: await page.evaluate(() => { const l = … [line shortened here: 497 characters; full line on GitHub]
d.forgedBucket.intercepted = intercepted;
await page.click('#cable'); await sleep(50);
// ---- T8: WebGL context loss ----
{ const r = await page.evaluate(async () => { const gl = document.querySelector('#gl').getContext('webgl2'); const ext = gl.getExtension('WEBGL_lose_context'); if (!ext) return { error: 'no WEBGL_lose_context' }; ext.loseContext(); await new Promise(r => setTimeout(r, 1500)); const lost = gl.isContextLost(); const hudText = Array.from(document.querySelectorAll('#hud div')).map(d => d.textContent … [line shortened here: 624 characters; full line on GitHub]
d.contextLoss = r; d.contextLoss.errorsLogged = errors.slice(); const errCount = errors.length;
await page.evaluate(async () => { const gl = document.querySelector('#gl').getContext('webgl2'); const ext = gl.getExtension('WEBGL_lose_context'); ext.restoreContext(); await new Promise(r => setTimeout(r, 1500)); });
d.contextLoss.afterRestore = await page.evaluate(() => { const gl = document.querySelector('#gl').getContext('webgl2'); const { B } = window.__qts; gl.bindBuffer(gl.ARRAY_BUFFER, B.sea); return { isContextLost: gl.isContextLost(), seaBufferSizeNow: gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), glError: gl.getError(), hudOnGPU: Array.from(document.querySelectorAll('#hud div')).map(d = … [line shortened here: 457 characters; full line on GitHub]
d.contextLoss.newErrorsAfterRestore = errors.length - errCount; d.contextLoss.errorsSample = errors.slice(-5); }
d.externalHosts = [...new Set(ext.map(e => new globalThis.URL(e.url).host))]; d.externalRequestsTotal = ext.length; d.errorsTotal = errors.length; d.errorsFirst = errors.slice(0, 8);
await page.close();
// ---- T9: phone 430×900 then rotate to 900×430 ----
{ const P = await newPage(430, 900, 2, true); const pg = P.page; await pg.goto(URL, { waitUntil: 'networkidle0', timeout: 120000 }); await sleep(4000);
const snap = () => pg.evaluate(() => { const { G } = window.__qts; const r = s => { const b = document.querySelector(s).getBoundingClientRect(); return { l: Math.round(b.left), t: Math.round(b.top), w: Math.round(b.width), h: Math.round(b.height) }; }; const cv = r('#gl'); const labels = Array.from(document.querySelectorAll('#labels .lb')).map(l => { const b = l.getBoundingClientRect(); return … [line shortened here: 1,091 characters; full line on GitHub]
R.phone = { portrait: await snap() }; await pg.setViewport({ width: 900, height: 430, deviceScaleFactor: 2, isMobile: true, hasTouch: true }); await sleep(1000); R.phone.landscapeAfterRotate = await snap(); R.phone.externalRequests = P.ext.length; R.phone.errors = P.errors; await pg.close(); }
// ---- T10: 375×667 DPR2 ----
{ const P = await newPage(375, 667, 2, true); const pg = P.page; await pg.goto(URL, { waitUntil: 'networkidle0', timeout: 120000 }); await sleep(4000);
R.phone375 = await pg.evaluate(() => ({ scrollWidth: document.documentElement.scrollWidth, bodyScrollWidth: document.body.scrollWidth, controlsInWidth: Array.from(document.querySelectorAll('#bar button, #bar input, #legend button, #legend select')).every(b => { const r = b.getBoundingClientRect(); return r.left >= 0 && r.right <= 375.5; }), hudPosition: getComputedStyle(document.querySelector( … [line shortened here: 603 characters; full line on GitHub]
R.phone375.externalRequests = P.ext.length; R.phone375.errors = P.errors; await pg.close(); }
} catch (e) { R.error = e.stack; }
await browser.close();
try { execSync(`taskkill /PID ${server.pid} /T /F`, { stdio: 'ignore' }); } catch (e) { R.serverKillError = e.message; }
await sleep(800);
try { const ns = execSync('netstat -ano', { encoding: 'utf8' }); R.portStillListening = ns.split('\n').some(l => l.includes(`127.0.0.1:${PORT}`) && l.includes('LISTENING')); } catch (e) { R.portCheckError = e.message; }
R.finished_utc = new Date().toISOString();
fs.writeFileSync(OUT + 'review2_report.json', JSON.stringify(R, null, 1));
console.log(JSON.stringify(R, null, 1));Review2b Check
A JavaScript module in the proof folder of GlobalGrid2050 that draws review2b report and cables.
renderglobalgrid2050 / testcode/202609142202/proof/review2b_check.mjs · lines 1–68 of 68 · version 2026-09-14 22:02 · Not reached from any entry point (candidate for review) · pattern hudFind (shared by 7 files)
- What it does
- It draws review2b report and cables. Defines sleep, newPage, hud, hudFind. Uses libraries node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: cables.
- Inputs & outputs
- Out: JSON file review2b_report.json; WebGL/WebGPU drawing.
- What it achieves
- It is built from the sleep step (`sleep`), the new page helper (`newPage`) and the hud step (`hud`). Adversarial review round 2, part b: forged bucket (answered locally WITH a CORS header), context loss/restore, phone rotation, 375 px. It writes `review2b_report.json`.
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · testcode/202609142202/proof · JavaScript module
- Uses
- GlobalGrid2050 Build News Feed V9 5 1 (script call), node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core
- Used by
- none found
- Produces
- sleep, newPage, hud, hudFind
- Defines here
- sleep, newPage, hud, hudFind
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609142202/proof/review2b_check.mjs:1-68 · blob f5a00532aa7b2869bc93baa23fe52d579d04237c · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
// Adversarial review round 2, part b: forged bucket (answered locally WITH a CORS header), context loss/restore, phone rotation, 375 px.
import { createRequire } from 'node:module';
import fs from 'node:fs';
import { spawn, execSync } from 'node:child_process';
const require = createRequire(import.meta.url);
const puppeteer = require('C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core');
const PORT = '8871';
const ROOT = 'C:/Users/vikra/Documents/GitHub/globalgrid2050';
const URL = `http://127.0.0.1:${PORT}/testcode/202609142202/index.html`;
const OUT = 'C:/Users/vikra/Documents/GitHub/globalgrid2050/testcode/202609142202/proof/';
const sleep = ms => new Promise(r => setTimeout(r, ms));
const R = { url: URL, started_utc: new Date().toISOString() };
const server = spawn('python', ['-m', 'http.server', PORT, '--bind', '127.0.0.1'], { cwd: ROOT, stdio: ['ignore', fs.openSync(OUT + 'review2b_server.log', 'w'), fs.openSync(OUT + 'review2b_server.log', 'a')] });
await sleep(1500);
const browser = await puppeteer.launch({ headless: 'new', executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', args: ['--enable-gpu', '--use-gl=angle', '--use-angle=d3d11', '--ignore-gpu-blocklist', '--enable-unsafe-webgpu', '--no-sandbox', '--window-size=1440,1000'] });
async function newPage(w, h, dpr, mobile) {
const page = await browser.newPage(); const ext = [], errors = [];
page.on('request', req => { const u = req.url(); if (!u.startsWith('http://127.0.0.1')) ext.push({ url: u, t: Date.now() }); });
page.on('pageerror', e => errors.push('pageerror: ' + e.message));
page.on('console', m => { const t = m.type(); if (t === 'error' || t === 'warning') errors.push(t + ': ' + m.text()); });
await page.setViewport({ width: w, height: h, deviceScaleFactor: dpr, isMobile: mobile, hasTouch: mobile });
return { page, ext, errors };
}
const hud = page => page.evaluate(() => Array.from(document.querySelectorAll('#hud div')).map(d => d.textContent));
const hudFind = async (page, re) => (await hud(page)).find(t => re.test(t)) || null;
try {
const { page, ext, errors } = await newPage(1440, 1000, 1, false);
await page.goto(URL, { waitUntil: 'networkidle0', timeout: 120000 }); await sleep(4000);
const d = R.desktop = {};
// ---- forged bucket, answered locally with ACAO so the browser accepts it; nothing goes to the network ----
const intercepted = [];
await page.setRequestInterception(true);
page.on('request', req => {
const u = req.url();
if (u.startsWith('http://127.0.0.1')) return req.continue();
if (/\/code\/f\/12\.json/.test(u)) { intercepted.push({ url: u, answered: 'locally with a forged bucket (3 lines, 3 repos)' }); return req.respond({ status: 200, headers: { 'Access-Control-Allow-Origin': '*' }, contentType: 'application/json', body: JSON.stringify({ '6076': { n: 6076, names: ['Number'], lines: [1, 2, 3], repos: ['forged-a', 'forged-b', 'forged-c'], places: [{ repo: 'Ventusltd/ … [line shortened here: 546 characters; full line on GitHub]
if (/raw\.githubusercontent\.com/.test(u)) { intercepted.push({ url: u, answered: 'locally with dummy text' }); return req.respond({ status: 200, headers: { 'Access-Control-Allow-Origin': '*' }, contentType: 'text/plain', body: Array.from({ length: 120 }, (_, i) => `DUMMY LINE ${i + 1} (answered locally by the review probe, not GitHub)`).join('\n') }); }
intercepted.push({ url: u, answered: 'ABORTED' }); return req.abort();
});
await page.click('#cable'); await sleep(100); await page.click('#measure'); await sleep(2500);
d.forgedBucket = { cableLine: await hudFind(page, /^cable/), liveRec: await page.evaluate(() => window.__qts.S.liveRec && { n: window.__qts.S.liveRec.n, lines: window.__qts.S.liveRec.rec.lines.length, repos: window.__qts.S.liveRec.rec.repos.length }) };
const btn = await page.$('#lines button.u-chip'); if (btn) { await btn.click(); await sleep(2500); d.forgedBucket.lineText = { note: await page.evaluate(() => { const n = document.querySelector('#lines .u-code .u-muted'); return n ? n.textContent : null; }), linesShown: await page.evaluate(() => document.querySelectorAll('#lines .u-line').length), lines: await page.evaluate(() => Array.from(docu … [line shortened here: 483 characters; full line on GitHub]
d.forgedBucket.intercepted = intercepted;
await page.click('#cable'); await sleep(50);
// ---- context loss, then restore with no handler in the page ----
const e0 = errors.length;
d.contextLoss = await page.evaluate(async () => { const gl = document.querySelector('#gl').getContext('webgl2'); const ext = gl.getExtension('WEBGL_lose_context'); window.__loseExt = ext; ext.loseContext(); await new Promise(r => setTimeout(r, 1500)); const t = Array.from(document.querySelectorAll('#hud div')).map(d => d.textContent); return { isContextLost: gl.isContextLost(), hudOnGPU: t.find( … [line shortened here: 532 characters; full line on GitHub]
d.contextLoss.errorsDuringLoss = errors.length - e0; const e1 = errors.length;
d.contextLoss.afterRestore = await page.evaluate(async () => { window.__loseExt.restoreContext(); await new Promise(r => setTimeout(r, 2000)); const gl = document.querySelector('#gl').getContext('webgl2'); const { B, S } = window.__qts; gl.bindBuffer(gl.ARRAY_BUFFER, B.sea); const sz = gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE); const t = Array.from(document.querySelectorAll('#hud di … [line shortened here: 962 characters; full line on GitHub]
d.contextLoss.errorsAfterRestore2s = errors.length - e1; d.contextLoss.errorSample = errors.slice(e1, e1 + 4);
d.externalRequestsTotal = ext.length; d.externalHosts = [...new Set(ext.map(e => new globalThis.URL(e.url).host))]; d.interceptedCount = intercepted.length;
await page.close();
// ---- phone 430×900 then rotate to 900×430 ----
{ const P = await newPage(430, 900, 2, true); const pg = P.page; await pg.goto(URL, { waitUntil: 'networkidle0', timeout: 120000 }); await sleep(4000);
const snap = () => pg.evaluate(() => { const { G, DPR } = window.__qts; const r = s => { const b = document.querySelector(s).getBoundingClientRect(); return { l: Math.round(b.left), t: Math.round(b.top), w: Math.round(b.width), h: Math.round(b.height) }; }; const cv = r('#gl'); const labels = Array.from(document.querySelectorAll('#labels .lb')).map(l => { const b = l.getBoundingClientRect(); r … [line shortened here: 1,142 characters; full line on GitHub]
R.phone = { portrait: await snap() }; await pg.setViewport({ width: 900, height: 430, deviceScaleFactor: 2, isMobile: true, hasTouch: true }); await sleep(1200); R.phone.landscapeAfterRotate = await snap(); await pg.screenshot({ path: OUT + 'review2-rotated-900x430.png' }); R.phone.externalRequests = P.ext.length; R.phone.errors = P.errors.slice(0, 5); await pg.close(); }
// ---- 375×667 DPR2 ----
{ const P = await newPage(375, 667, 2, true); const pg = P.page; await pg.goto(URL, { waitUntil: 'networkidle0', timeout: 120000 }); await sleep(4000);
R.phone375 = await pg.evaluate(() => ({ scrollWidth: document.documentElement.scrollWidth, bodyScrollWidth: document.body.scrollWidth, controlsInWidth: Array.from(document.querySelectorAll('#bar button, #bar input, #legend button, #legend select')).every(b => { const r = b.getBoundingClientRect(); return r.left >= 0 && r.right <= 375.5; }), widest: Array.from(document.querySelectorAll('#bar bu … [line shortened here: 826 characters; full line on GitHub]
R.phone375.externalRequests = P.ext.length; R.phone375.errors = P.errors.slice(0, 5); await pg.close(); }
} catch (e) { R.error = e.stack; }
await browser.close();
try { execSync(`taskkill /PID ${server.pid} /T /F`, { stdio: 'ignore' }); } catch (e) { R.serverKillError = e.message; }
await sleep(800);
try { const ns = execSync('netstat -ano', { encoding: 'utf8' }); R.portStillListening = ns.split('\n').some(l => l.includes(`127.0.0.1:${PORT}`) && l.includes('LISTENING')); } catch (e) { R.portCheckError = e.message; }
R.finished_utc = new Date().toISOString();
fs.writeFileSync(OUT + 'review2b_report.json', JSON.stringify(R, null, 1));
console.log(JSON.stringify(R, null, 1));Verify 1
A JavaScript module in the proof folder of GlobalGrid2050 that opens page (`openPage`) and renders with WebGL, using haversine. It opens page (`openPage`) and parses state (`parseState`).
renderglobalgrid2050 / testcode/202609142202/proof/verify-1.mjs · lines 1–156 of 156 · version 2026-09-14 22:02 · Not reached from any entry point (candidate for review) · pattern parseState (shared by 2 files)
- What it does
- It draws its content. Defines 8 functions or classes, including sleep, smi, hudLines, hudFind, fps3s. Uses libraries node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
- Inputs & outputs
- Out: JSON file verify-1.json; WebGL/WebGPU drawing.
- What it achieves
- Independent GPU runner, round 1 — verification of `testcode/202609142202/index.html`. It writes `verify-1.json`.
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · testcode/202609142202/proof · JavaScript module
- Uses
- node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core
- Used by
- none found
- Produces
- sleep, smi, hudLines, hudFind, fps3s, openPage, parseState, stat
- Defines here
- sleep, smi, hudLines, hudFind, fps3s, openPage, parseState, stat
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609142202/proof/verify-1.mjs:1-156 · blob 0e18476051ec1aec3a977eff237256a6eb4a600d · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
// Independent GPU runner, round 1 — verification of testcode/202609142202/index.html.
// Own script; nothing here trusts the builder's proof.mjs or report.json.
import { createRequire } from 'node:module';
import fs from 'node:fs';
import { spawn, execFile } from 'node:child_process';
const require = createRequire(import.meta.url);
const puppeteer = require('C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core');
const ROOT = 'C:/Users/vikra/Documents/GitHub/globalgrid2050';
const DIR = ROOT + '/testcode/202609142202';
const OUT = DIR + '/proof/';
const PORT = 8871;
const URL = `http://127.0.0.1:${PORT}/testcode/202609142202/index.html`;
const sleep = ms => new Promise(r => setTimeout(r, ms));
const R = { url: URL, started: new Date().toISOString() };
// (3) lines.bin read by this script, not by the page
const bin = fs.readFileSync(DIR + '/data/lines.bin');
const keys = new Uint32Array(bin.buffer, bin.byteOffset, bin.byteLength >>> 2);
const keySet = new Set(keys);
R.linesBin = { bytes: bin.byteLength, entries: bin.byteLength / 4, distinct: keySet.size, remainderBytes: bin.byteLength % 4 };
// (9) nvidia-smi sampling
function smi() { return new Promise(res => execFile('nvidia-smi', ['--query-gpu=utilization.gpu,memory.used,name', '--format=csv,noheader,nounits'], (e, so) => { if (e) return res({ err: e.message }); const [u, m, n] = so.trim().split(',').map(s => s.trim()); res({ t: Date.now(), util: +u, memMiB: +m, name: n }); })); }
const idle = []; for (let i = 0; i < 8; i++) { idle.push(await smi()); await sleep(1000); }
R.nvidiaIdle = idle;
const live = []; let sampling = true;
(async () => { while (sampling) { live.push(await smi()); await sleep(1000); } })();
// static server (own process; killed at the end)
const server = spawn('python', ['-m', 'http.server', String(PORT), '--bind', '127.0.0.1'], { cwd: ROOT, stdio: ['ignore', 'pipe', 'pipe'] });
let serverLog = ''; server.stdout.on('data', d => serverLog += d); server.stderr.on('data', d => serverLog += d);
await sleep(1500);
const browser = await puppeteer.launch({
headless: 'new', executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
args: ['--enable-gpu', '--use-gl=angle', '--use-angle=d3d11', '--ignore-gpu-blocklist', '--enable-unsafe-webgpu', '--no-sandbox', '--window-size=1440,1000']
});
R.chrome = await browser.version();
const hudLines = p => p.evaluate(() => Array.from(document.querySelectorAll('#hud div')).map(d => d.textContent));
const hudFind = async (p, re) => (await hudLines(p)).find(t => re.test(t)) || null;
const fps3s = p => p.evaluate(() => new Promise(res => { let n = 0; const t0 = performance.now(); const tick = t => { n++; if (t - t0 < 3000) requestAnimationFrame(tick); else res({ frames: n, ms: +(t - t0).toFixed(1), fps: +(n * 1000 / (t - t0)).toFixed(1) }); }; requestAnimationFrame(tick); }));
const rendererOwn = p => p.evaluate(() => { const c = document.createElement('canvas'); const gl = c.getContext('webgl2') || c.getContext('webgl'); if (!gl) return { webgl: false }; const d = gl.getExtension('WEBGL_debug_renderer_info'); return { webgl: true, unmaskedRenderer: d ? gl.getParameter(d.UNMASKED_RENDERER_WEBGL) : null, unmaskedVendor: d ? gl.getParameter(d.UNMASKED_VENDOR_WEBGL) : null … [line shortened here: 447 characters; full line on GitHub]
async function openPage(width, height) {
const page = await browser.newPage();
const issues = [], logs = [];
page.on('console', m => { const t = m.type(); (t === 'error' || t === 'warning' || t === 'warn') ? issues.push(t + ': ' + m.text()) : logs.push(t + ': ' + m.text()); });
page.on('pageerror', e => issues.push('pageerror: ' + e.message));
page.on('requestfailed', r => issues.push('requestfailed: ' + r.url() + ' ' + ((r.failure() || {}).errorText || '')));
await page.setViewport({ width, height, deviceScaleFactor: 1, isMobile: width < 768, hasTouch: width < 768 });
const t0 = Date.now();
await page.goto(URL, { waitUntil: 'load', timeout: 120000 });
await sleep(8000); // (2) 8 s window
return { page, issues, logs, loadMs: Date.now() - t0 };
}
try {
// ===== 1440 x 900 =====
const A = await openPage(1440, 900); const p = A.page; const a = { width: 1440, height: 900, loadMs: A.loadMs };
a.consoleIssues8s = A.issues.slice(); a.consoleOther = A.logs.slice(0, 10);
a.rendererOwnCanvas = await rendererOwn(p); // (1)
a.rendererHudLine = await hudFind(p, /^renderer:/);
a.hudOnGpuLine = await hudFind(p, /^on GPU:/); // (3)
a.hudPointCount = a.hudOnGpuLine ? +(/on GPU: ([\d,]+) line entries/.exec(a.hudOnGpuLine) || [, 'NaN'])[1].replace(/,/g, '') : null;
a.hudDistinct = a.hudOnGpuLine ? +(/([\d,]+) distinct/.exec(a.hudOnGpuLine) || [, 'NaN'])[1].replace(/,/g, '') : null;
a.pageState = await p.evaluate(() => { const q = window.__qts; return q ? { seaDrawn: q.S.seaDrawn, seaBytes: q.S.seaBytes, seaStride: q.S.seaStride, N: q.D.N, keysLen: q.D.keys.length, distinct: q.D.distinct, renderer: q.S.renderer, DPR: q.DPR, phoneMode: q.S.phoneMode } : null; });
a.pointCountMatchesLinesBin = a.hudPointCount === R.linesBin.entries;
a.scrollWidth = await p.evaluate(() => document.documentElement.scrollWidth); // (5)
a.fps = await fps3s(p); // (4)
a.hudFpsLine = await hudFind(p, /^fps/);
// (6) click a visible point: click at a drawn family's screen position (from the page's own layout), spiral out a few px until the 1-px pick hits
const bornBefore = await hudFind(p, /^Born audit:/);
await p.evaluate(() => { document.querySelector('#hud').style.pointerEvents = 'none'; });
const fam = await p.evaluate(() => { const { S, G, D, familyPos, DPR } = window.__qts; let fi = Math.floor(D.families.length * 0.37); const c = document.querySelector('#gl').getBoundingClientRect(); const pos = familyPos(fi); return { fi, n: D.families[fi].n, name: D.families[fi].name, x: c.left + (G.c0[0] + pos[0] * G.R + S.view.x) / DPR, y: c.top + (G.c0[1] + pos[1] * G.R + S.view.y) / DPR, ca … [line shortened here: 461 characters; full line on GitHub]
const offsets = [[0, 0], [1, 0], [-1, 0], [0, 1], [0, -1], [1, 1], [-1, -1], [1, -1], [-1, 1], [2, 0], [-2, 0], [0, 2], [0, -2], [2, 2], [-2, -2], [3, 0], [-3, 0], [0, 3], [0, -3], [3, 3], [-3, 3], [3, -3], [-3, -3], [4, 0], [-4, 0], [0, 4], [0, -4]];
let pickMsg = null, attempts = 0, pickPt = null;
for (const [dx, dy] of offsets) { attempts++; pickPt = { x: Math.round(fam.x + dx), y: Math.round(fam.y + dy) }; await p.mouse.click(pickPt.x, pickPt.y); await sleep(350); pickMsg = await hudFind(p, /^#\d+ · family #\d+|^tap hit no entry|^pick framebuffer/); if (pickMsg && /^#\d+ · family/.test(pickMsg)) break; }
a.pick = { targetFamily: fam, attempts, clickedAt: pickPt, hudMsg: pickMsg };
const pm = /^#(\d+) · family #(\d+)/.exec(pickMsg || ''); a.pick.hit = !!pm;
if (pm) { a.pick.key = +pm[1]; a.pick.familyN = +pm[2]; a.pick.keyInLinesBin = keySet.has(+pm[1]); }
await sleep(1000);
const panel = await p.evaluate(() => { const el = document.querySelector('#lines'); return { hidden: el.hidden, header: (el.querySelector('.u-h') || {}).textContent || null, keys: Array.from(el.querySelectorAll('.u-line .u-key')).map(s => +s.textContent), totalLines: el.querySelectorAll('.u-line').length }; });
a.pick.linesPanel = { hidden: panel.hidden, header: panel.header, shownKeys: panel.keys.length, firstKeys: panel.keys.slice(0, 8), allShownKeysExistInLinesBin: panel.keys.length > 0 && panel.keys.every(k => keySet.has(k)), missing: panel.keys.filter(k => !keySet.has(k)).slice(0, 5) };
a.pick.bornAuditBeforeClick = bornBefore; a.pick.bornAuditAfterClick = await hudFind(p, /^Born audit:/);
a.pick.stateAfterClick = await hudFind(p, /^state:|^shells not shipped|^no focus/);
// does clicking measure? press the measure button once on the picked focus and record what the page says
await p.click('#measure'); await sleep(1500);
a.pick.bornAuditAfterMeasureButton = await hudFind(p, /^Born audit:/);
a.pick.msgAfterMeasureButton = await hudFind(p, /^nothing to measure|^measured|^no electrons/);
a.pick.bornChangedAfterMeasureButton = a.pick.bornAuditAfterMeasureButton !== bornBefore;
// (7) search #80299
await p.evaluate(() => { document.querySelector('#search').value = ''; }); await p.click('#search'); await p.keyboard.type('#80299'); await p.keyboard.press('Enter'); await sleep(700);
const s = {}; s.steerMsg = await hudFind(p, /^family #80299|^line #80299|^soul #80299|^#80299/); s.steerHasHaversine = /haversine/.test(s.steerMsg || '');
s.joinLine = await hudFind(p, /^join:/); s.stateAfterSteer = await hudFind(p, /^state:|^shells not shipped|^no focus/);
s.familyKeysInLinesBin = await p.evaluate(() => { const { S, D } = window.__qts; if (S.famIdx < 0) return null; const f = D.families[S.famIdx]; return { n: f.n, name: f.name, lineCount: f.lineCount, keys: Array.from(D.keys.subarray(f.lineOffset, f.lineOffset + f.lineCount)) }; });
if (s.familyKeysInLinesBin) s.familyKeysInLinesBin.allExist = s.familyKeysInLinesBin.keys.every(k => keySet.has(k));
const born80299Before = await hudFind(p, /^Born audit:/);
await p.keyboard.press('Enter'); await sleep(1500); // second Enter = measure per the page's own rule
s.secondEnterMsg = await hudFind(p, /^nothing to measure|^measured|^no electrons/);
s.bornAuditAfterSecondEnter = await hudFind(p, /^Born audit:/); s.measured = s.bornAuditAfterSecondEnter !== born80299Before && /measured #/.test(s.bornAuditAfterSecondEnter || '');
s.bornMentionsHaversine = /haversine/.test(s.bornAuditAfterSecondEnter || '');
a.search80299 = s;
// (8) Bloch drag — needs an atom in focus; ArrowRight walks the conduction band which always focuses an atom
await p.evaluate(() => document.querySelector('#search').blur()); await p.keyboard.press('ArrowRight'); await sleep(500);
const b = {}; b.focus = await hudFind(p, /^conduction band/); b.stateBefore = await hudFind(p, /^state:/);
const parseState = t => { const m = /θ=([\d.]+)° φ=([\d.]+)°.*\|α\|²\+\|β\|²=([\d.]+)/.exec(t || ''); return m ? { theta: +m[1], phi: +m[2], norm: +m[3] } : null; };
b.before = parseState(b.stateBefore);
const sh = await p.evaluate(() => { const r = document.querySelector('#sphereHandle').getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2, w: r.width, h: r.height }; });
b.handle = sh;
await p.mouse.move(sh.x, sh.y); await p.mouse.down(); await p.mouse.move(sh.x + 40, sh.y - 30, { steps: 10 }); await sleep(400);
b.stateDuringDrag = await hudFind(p, /^state:/); b.during = parseState(b.stateDuringDrag);
b.samples = [b.during];
await p.mouse.move(sh.x + 80, sh.y + 20, { steps: 10 }); await sleep(400); b.stateDuringDrag2 = await hudFind(p, /^state:/); b.during2 = parseState(b.stateDuringDrag2); b.samples.push(b.during2);
await p.mouse.up(); await sleep(300); b.stateAfterRelease = await hudFind(p, /^state:/); b.after = parseState(b.stateAfterRelease);
b.thetaChanged = !!(b.before && b.during && Math.abs(b.during.theta - b.before.theta) > 0.05);
b.phiChanged = !!(b.before && b.during && Math.abs(b.during.phi - b.before.phi) > 0.05);
b.preparedByHand = /prepared by hand/.test(b.stateDuringDrag || '');
b.normAlwaysOne = [b.before, b.during, b.during2, b.after].every(x => x && Math.abs(x.norm - 1) < 0.0005);
a.bloch = b;
a.consoleIssuesWholeRun = A.issues.slice();
await p.screenshot({ path: OUT + 'verify-1-1440.png', fullPage: false }); // (10)
R.run1440 = a; await p.close();
// ===== 430 x 900 =====
const B = await openPage(430, 900); const q = B.page; const c = { width: 430, height: 900, loadMs: B.loadMs };
c.consoleIssues8s = B.issues.slice();
c.rendererOwnCanvas = await rendererOwn(q); c.rendererHudLine = await hudFind(q, /^renderer:/);
c.hudOnGpuLine = await hudFind(q, /^on GPU:/);
c.hudPointCount = c.hudOnGpuLine ? +(/on GPU: ([\d,]+) line entries/.exec(c.hudOnGpuLine) || [, 'NaN'])[1].replace(/,/g, '') : null;
c.pointCountMatchesLinesBin = c.hudPointCount === R.linesBin.entries;
c.pageState = await q.evaluate(() => { const s = window.__qts; return s ? { seaDrawn: s.S.seaDrawn, seaStride: s.S.seaStride, phoneMode: s.S.phoneMode, DPR: s.DPR } : null; });
c.scrollWidth = await q.evaluate(() => document.documentElement.scrollWidth);
c.bodyScrollWidth = await q.evaluate(() => document.body.scrollWidth);
c.innerWidth = await q.evaluate(() => innerWidth);
c.fps = await fps3s(q);
c.consoleIssuesWholeRun = B.issues.slice();
await q.screenshot({ path: OUT + 'verify-1-430.png', fullPage: false });
R.run430 = c; await q.close();
} catch (e) { R.error = e.stack; }
sampling = false; await sleep(1100);
R.nvidiaLive = live;
const stat = arr => { const u = arr.filter(x => x.util != null).map(x => x.util), m = arr.filter(x => x.memMiB != null).map(x => x.memMiB); const f = v => v.length ? { min: Math.min(...v), max: Math.max(...v), mean: +(v.reduce((a, b) => a + b, 0) / v.length).toFixed(1), n: v.length } : null; return { util: f(u), memMiB: f(m) }; };
R.nvidiaSummary = { idle: stat(idle), live: stat(live), gpuName: (idle[0] || {}).name };
await browser.close();
server.kill(); await sleep(500);
R.serverKilled = server.killed; R.serverLogTail = serverLog.slice(-600);
R.finished = new Date().toISOString();
fs.writeFileSync(OUT + 'verify-1.json', JSON.stringify(R, null, 1));
console.log(JSON.stringify(R, null, 1));Verify 1b
A JavaScript module in the proof folder of GlobalGrid2050 that works with hud lines (`hudLines`) and hud find (`hudFind`).
renderglobalgrid2050 / testcode/202609142202/proof/verify-1b.mjs · lines 1–80 of 80 · version 2026-09-14 22:02 · Not reached from any entry point (candidate for review) · pattern parseState (shared by 2 files)
- What it does
- It loads data. Defines sleep, hudLines, hudFind, parseState. Uses libraries node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
- Inputs & outputs
- Out: JSON file verify-1b.json.
- What it achieves
- It parses state (`parseState`) and is built from the sleep step (`sleep`) and the hud lines helper (`hudLines`). Independent GPU runner, round 1 — supplement to `verify-1.mjs`. It writes `verify-1b.json`.
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · testcode/202609142202/proof · JavaScript module
- Uses
- node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core
- Used by
- none found
- Produces
- sleep, hudLines, hudFind, parseState
- Defines here
- sleep, hudLines, hudFind, parseState
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609142202/proof/verify-1b.mjs:1-80 · blob 28b8cb2b1b05ce2ab6ff1d6f9a4e64b4dace40c5 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
// Independent GPU runner, round 1 — supplement to verify-1.mjs.
// Round-1 main run clicked a point whose family has no electron record, so the page refused to measure.
// Here: click a point of a family that HAS a name-matched atom, then measure; and drag the Bloch handle downward so theta moves.
import { createRequire } from 'node:module';
import fs from 'node:fs';
import { spawn, execFileSync } from 'node:child_process';
const require = createRequire(import.meta.url);
const puppeteer = require('C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core');
const ROOT = 'C:/Users/vikra/Documents/GitHub/globalgrid2050';
const DIR = ROOT + '/testcode/202609142202';
const OUT = DIR + '/proof/';
const PORT = 8871;
const URL = `http://127.0.0.1:${PORT}/testcode/202609142202/index.html`;
const sleep = ms => new Promise(r => setTimeout(r, ms));
const R = { url: URL, started: new Date().toISOString() };
const bin = fs.readFileSync(DIR + '/data/lines.bin');
const keys = new Uint32Array(bin.buffer, bin.byteOffset, bin.byteLength >>> 2); const keySet = new Set(keys);
R.linesBin = { bytes: bin.byteLength, entries: keys.length };
const server = spawn('python', ['-m', 'http.server', String(PORT), '--bind', '127.0.0.1'], { cwd: ROOT, stdio: 'ignore' });
await sleep(1500);
const browser = await puppeteer.launch({ headless: 'new', executablePath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
args: ['--enable-gpu', '--use-gl=angle', '--use-angle=d3d11', '--ignore-gpu-blocklist', '--enable-unsafe-webgpu', '--no-sandbox', '--window-size=1440,1000'] });
const hudLines = p => p.evaluate(() => Array.from(document.querySelectorAll('#hud div')).map(d => d.textContent));
const hudFind = async (p, re) => (await hudLines(p)).find(t => re.test(t)) || null;
const parseState = t => { const m = /θ=([\d.]+)° φ=([\d.]+)°.*\|α\|²\+\|β\|²=([\d.]+)/.exec(t || ''); return m ? { theta: +m[1], phi: +m[2], norm: +m[3] } : null; };
try {
const p = await browser.newPage(); const issues = [];
p.on('console', m => { const t = m.type(); if (t === 'error' || t === 'warning' || t === 'warn') issues.push(t + ': ' + m.text()); });
p.on('pageerror', e => issues.push('pageerror: ' + e.message)); p.on('requestfailed', r => issues.push('requestfailed: ' + r.url()));
await p.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
await p.goto(URL, { waitUntil: 'load', timeout: 120000 }); await sleep(6000);
R.renderer = await hudFind(p, /^renderer:/);
await p.evaluate(() => { document.querySelector('#hud').style.pointerEvents = 'none'; });
// choose families whose name matches a shipped atom with K+L+M > 0, spread across the list; click each until a pick hits
const cands = await p.evaluate(() => { const { D } = window.__qts; const out = []; for (let fi = 0; fi < D.families.length; fi += 97) { const f = D.families[fi]; const at = D.atomByName.get(f.name); if (at && at[0] && (at[0].shells.K + at[0].shells.L + at[0].shells.M) > 0) out.push({ fi, n: f.n, name: f.name, atomN: at[0].n }); } return out.slice(0, 12); });
R.candidates = cands;
const offsets = [[0, 0], [1, 0], [-1, 0], [0, 1], [0, -1], [1, 1], [-1, -1], [1, -1], [-1, 1], [2, 0], [-2, 0], [0, 2], [0, -2]];
let hit = null; R.clickLog = [];
for (const cnd of cands) {
const pt = await p.evaluate(fi => { const { S, G, familyPos, DPR } = window.__qts; const c = document.querySelector('#gl').getBoundingClientRect(); const pos = familyPos(fi); return { x: c.left + (G.c0[0] + pos[0] * G.R + S.view.x) / DPR, y: c.top + (G.c0[1] + pos[1] * G.R + S.view.y) / DPR }; }, cnd.fi);
for (const [dx, dy] of offsets) { const x = Math.round(pt.x + dx), y = Math.round(pt.y + dy); await p.mouse.click(x, y); await sleep(300); const msg = await hudFind(p, /^#\d+ · family #\d+|^tap hit no entry/); R.clickLog.push({ target: cnd.n, x, y, msg }); const m = /^#(\d+) · family #(\d+)/.exec(msg || ''); if (m) { hit = { target: cnd, clickedAt: { x, y }, msg, key: +m[1], familyN: +m[2] }; … [line shortened here: 410 characters; full line on GitHub]
if (hit) { const st = await hudFind(p, /^state:|^shells not shipped/); hit.stateAfterClick = st; if (/^state:/.test(st || '')) break; hit = null; } // keep going if the hit family has no atom
}
R.pick = hit;
if (hit) {
hit.keyInLinesBin = keySet.has(hit.key);
await sleep(800);
const panel = await p.evaluate(() => { const el = document.querySelector('#lines'); return { hidden: el.hidden, header: (el.querySelector('.u-h') || {}).textContent || null, keys: Array.from(el.querySelectorAll('.u-line .u-key')).map(s => +s.textContent) }; });
hit.linesPanel = { hidden: panel.hidden, header: panel.header, shownKeys: panel.keys.length, firstKeys: panel.keys.slice(0, 8), allShownKeysExistInLinesBin: panel.keys.length > 0 && panel.keys.every(k => keySet.has(k)) };
hit.joinLine = await hudFind(p, /^join:/);
hit.bornBefore = await hudFind(p, /^Born audit:/);
// the page's rule: a tap on the sphere / the measure button / a second Enter measures. Use the measure button.
await p.click('#measure'); await sleep(1500);
hit.bornAfterMeasure = await hudFind(p, /^Born audit:/); hit.stateAfterMeasure = await hudFind(p, /^state:/); hit.twinLine = await hudFind(p, /^twin tier:/);
hit.measured = hit.bornAfterMeasure !== hit.bornBefore && /measured #/.test(hit.bornAfterMeasure || '');
hit.record = await p.evaluate(() => document.querySelector('#record').textContent);
// also: does a tap on the sphere itself measure? (second measurement)
const sh = await p.evaluate(() => { const r = document.querySelector('#sphereHandle').getBoundingClientRect(); return { x: r.left + r.width / 2, y: r.top + r.height / 2 }; });
await p.mouse.click(sh.x, sh.y); await sleep(1500); hit.bornAfterSphereTap = await hudFind(p, /^Born audit:/); hit.sphereTapMeasured = hit.bornAfterSphereTap !== hit.bornAfterMeasure && /measured #/.test(hit.bornAfterSphereTap || '');
await sleep(2500); hit.cableLine = await hudFind(p, /^cable:/);
// Bloch drag, downward this time (dy > 0 lowers theta) — state is post-collapse; the drag re-prepares by hand
const b = {}; b.stateBefore = await hudFind(p, /^state:/); b.before = parseState(b.stateBefore);
await p.mouse.move(sh.x, sh.y); await p.mouse.down(); await p.mouse.move(sh.x + 35, sh.y + 45, { steps: 10 }); await sleep(400);
b.stateDuring = await hudFind(p, /^state:/); b.during = parseState(b.stateDuring);
await p.mouse.move(sh.x - 20, sh.y + 90, { steps: 10 }); await sleep(400); b.stateDuring2 = await hudFind(p, /^state:/); b.during2 = parseState(b.stateDuring2);
await p.mouse.up(); await sleep(300); b.stateAfter = await hudFind(p, /^state:/); b.after = parseState(b.stateAfter);
b.thetaChanged = !!(b.before && b.during && Math.abs(b.during.theta - b.before.theta) > 0.05); b.phiChanged = !!(b.before && b.during && Math.abs(b.during.phi - b.before.phi) > 0.05);
b.normAlwaysOne = [b.before, b.during, b.during2, b.after].every(x => x && Math.abs(x.norm - 1) < 0.0005); b.preparedByHand = /prepared by hand/.test(b.stateDuring || '');
R.bloch = b;
}
R.consoleIssues = issues;
await p.screenshot({ path: OUT + 'verify-1b-1440.png' });
await p.close();
} catch (e) { R.error = e.stack; }
await browser.close();
try { execFileSync('taskkill', ['/PID', String(server.pid), '/T', '/F']); R.serverKill = 'taskkill ok pid ' + server.pid; } catch (e) { R.serverKill = 'taskkill failed: ' + e.message; }
R.finished = new Date().toISOString();
fs.writeFileSync(OUT + 'verify-1b.json', JSON.stringify(R, null, 1));
console.log(JSON.stringify(R, null, 1));Verify 2
A JavaScript module in the proof folder of GlobalGrid2050 that draws families and electron, using haversine. It opens page (`openPage`) and measures fps (`measureFps`).
renderglobalgrid2050 / testcode/202609142202/proof/verify-2.mjs · lines 1–208 of 208 · version 2026-09-14 22:02 · Not reached from any entry point (candidate for review) · pattern measureFps (shared by 2 files)
- What it does
- It draws families and electron. Defines 11 functions or classes, including log, sleep, smi, stats, openPage. Uses libraries node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
- Inputs & outputs
- In: JSON file families.json; JSON file electron.json; JSON file verify-2.json. Out: JSON file verify-2.json; WebGL/WebGPU drawing.
- What it achieves
- Independent GPU runner, round 2. Reads only; writes `proof/verify-2.json` and two screenshots. run from anywhere: node C:`/Users/vikra/Documents/GitHub/globalgrid2050/testcode/202609142202/proof/verify-2.mjs`. It reads `/data/families.json` and writes `/proof/verify-2.json`.
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · testcode/202609142202/proof · JavaScript module
- Uses
- node:module, node:fs, node:child_process, C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core
- Used by
- none found
- Produces
- log, sleep, smi, stats, openPage, hudText, hudLines, born, stateLine, measureFps, topAt
- Defines here
- log, sleep, smi, stats, openPage, hudText, hudLines, born, stateLine, measureFps, topAt
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609142202/proof/verify-2.mjs:1-208 · blob da9e1354e855a2863a2b3ade4e26d8686afeb976 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
// verify-2.mjs — independent GPU runner, round 2. Reads only; writes proof/verify-2.json and two screenshots.
// run from anywhere: node C:/Users/vikra/Documents/GitHub/globalgrid2050/testcode/202609142202/proof/verify-2.mjs
import { createRequire } from 'node:module';
import fs from 'node:fs';
import { spawn, execFileSync } from 'node:child_process';
const require = createRequire(import.meta.url);
const puppeteer = require('C:/Users/vikra/Desktop/Claude-Sandbox-MSI/bench/node_modules/puppeteer-core');
const ROOT = 'C:/Users/vikra/Documents/GitHub/globalgrid2050';
const DIR = ROOT + '/testcode/202609142202';
const PORT = 8871;
const URL = `http://127.0.0.1:${PORT}/testcode/202609142202/index.html`;
const CHROME = 'C:/Program Files/Google/Chrome/Application/chrome.exe';
const R = { started_utc: new Date().toISOString(), port: PORT, url: URL };
const log = (...a) => console.log(...a);
const sleep = ms => new Promise(r => setTimeout(r, ms));
// ---- ground truth from disk ----
const linesBuf = fs.readFileSync(DIR + '/data/lines.bin');
R.lines_bin_bytes = linesBuf.byteLength; R.lines_bin_entries = linesBuf.byteLength / 4;
const keys = new Uint32Array(linesBuf.buffer, linesBuf.byteOffset, linesBuf.byteLength / 4);
const keySet = new Set(keys);
const families = JSON.parse(fs.readFileSync(DIR + '/data/families.json', 'utf8'));
const electron = JSON.parse(fs.readFileSync(DIR + '/data/electron.json', 'utf8'));
const atomNames = new Set(electron.atoms.map(a => a.name));
R.family_80299 = families.find(f => f.n === 80299) || null;
R.atom_named_haversine_exists = atomNames.has('haversine');
log('lines.bin', R.lines_bin_bytes, 'bytes =', R.lines_bin_entries, 'uint32 entries; distinct', keySet.size);
// ---- nvidia-smi sampler ----
const smi = () => { try { const s = execFileSync('nvidia-smi', ['--query-gpu=utilization.gpu,memory.used', '--format=csv,noheader,nounits'], { encoding: 'utf8' }).trim().split(',').map(x => +x.trim()); return { util: s[0], mem: s[1], t: Date.now() }; } catch (e) { return { err: e.message, t: Date.now() }; } };
const stats = arr => { const u = arr.map(x => x.util), m = arr.map(x => x.mem); const mean = a => a.reduce((s, v) => s + v, 0) / a.length; return { n: arr.length, util_mean: +mean(u).toFixed(1), util_min: Math.min(...u), util_max: Math.max(...u), mem_mean_MiB: +mean(m).toFixed(0), mem_min_MiB: Math.min(...m), mem_max_MiB: Math.max(...m), samples: arr.map(x => `${x.util}%/${x.mem}MiB`) }; };
const idle = []; log('sampling nvidia-smi idle for 6 s (no server, no browser)…'); for (let i = 0; i < 6; i++) { idle.push(smi()); await sleep(1000); }
R.gpu_idle = stats(idle); log('idle', JSON.stringify(R.gpu_idle));
// ---- static server ----
const server = spawn('python', ['-m', 'http.server', String(PORT), '--bind', '127.0.0.1'], { cwd: ROOT, stdio: ['ignore', 'pipe', 'pipe'] });
const serverLog = fs.createWriteStream(DIR + '/proof/verify-2-server.log'); server.stdout.pipe(serverLog); server.stderr.pipe(serverLog);
await sleep(1500);
const live = []; let sampling = true; const sampler = (async () => { while (sampling) { live.push(smi()); await sleep(1000); } })();
let browser;
try {
browser = await puppeteer.launch({ executablePath: CHROME, headless: 'new', args: ['--enable-gpu', '--use-gl=angle', '--use-angle=d3d11', '--ignore-gpu-blocklist', '--enable-unsafe-webgpu', '--no-first-run', '--no-default-browser-check'] });
R.chrome_version = await browser.version();
async function openPage(w, h, tag) {
const page = await browser.newPage(); await page.setViewport({ width: w, height: h, deviceScaleFactor: 1 });
const con = []; const errs = []; const external = []; const failed = [];
page.on('console', m => con.push({ type: m.type(), text: m.text().slice(0, 300) }));
page.on('pageerror', e => errs.push(String(e && e.message || e).slice(0, 300)));
page.on('requestfailed', r => failed.push(r.url() + ' ' + (r.failure() && r.failure().errorText)));
page.on('request', r => { const u = r.url(); if (!u.startsWith(`http://127.0.0.1:${PORT}/`)) external.push(u); });
const t0 = Date.now(); await page.goto(URL, { waitUntil: 'load' });
await page.waitForFunction(() => window.__qts && window.__qts.S && window.__qts.S.seaDrawn > 0, { timeout: 60000 });
const readyMs = Date.now() - t0;
return { page, con, errs, external, failed, readyMs, tag };
}
const hudText = p => p.evaluate(() => document.querySelector('#hud').innerText);
const hudLines = p => p.evaluate(() => Array.from(document.querySelectorAll('#hud div')).map(d => d.textContent));
const born = async p => (await hudLines(p)).find(l => l.startsWith('Born audit:')) || null;
const stateLine = async p => (await hudLines(p)).find(l => l.startsWith('state:')) || null;
const measureFps = p => p.evaluate(() => new Promise(res => { let n = 0; const t0 = performance.now(); const f = t => { n++; if (t - t0 < 3000) requestAnimationFrame(f); else res({ frames: n, ms: +(t - t0).toFixed(1), fps: +((n - 1) * 1000 / (t - t0)).toFixed(1) }); }; requestAnimationFrame(f); }));
// =================== DESKTOP 1440x900 ===================
const D = await openPage(1440, 900, 'desktop'); const page = D.page; R.desktop = { readyMs: D.readyMs };
log('desktop page ready in', D.readyMs, 'ms');
// (1) renderer, read in the page context from a fresh webgl2 context and from the page's own S.renderer
R.desktop.renderer_fresh_context = await page.evaluate(() => { const c = document.createElement('canvas'); const gl = c.getContext('webgl2'); if (!gl) return 'no webgl2'; const d = gl.getExtension('WEBGL_debug_renderer_info'); return d ? gl.getParameter(d.UNMASKED_RENDERER_WEBGL) : 'ext missing: ' + gl.getParameter(gl.RENDERER); });
R.desktop.renderer_page_S = await page.evaluate(() => window.__qts.S.renderer);
log('renderer (fresh ctx):', R.desktop.renderer_fresh_context); log('renderer (S.renderer):', R.desktop.renderer_page_S);
// (2) console during 8 s after ready
await sleep(8000);
R.desktop.console_8s = { all: D.con.length, errors: D.con.filter(c => c.type === 'error'), warnings: D.con.filter(c => c.type === 'warning' || c.type === 'warn'), pageerrors: D.errs.slice(), requestfailed: D.failed.slice(), external_requests: D.external.slice(), other: D.con.filter(c => !['error', 'warning', 'warn'].includes(c.type)).slice(0, 20) };
log('console 8 s:', JSON.stringify({ all: D.con.length, errors: R.desktop.console_8s.errors.length, warnings: R.desktop.console_8s.warnings.length, pageerrors: D.errs.length, requestfailed: D.failed.length, external: D.external.length }));
// (3) HUD point count vs lines.bin
const hud = await hudText(page); const m = /on GPU: ([\d,]+) line entries/.exec(hud);
R.desktop.hud_on_gpu_text = m ? m[0] : null; R.desktop.hud_point_count = m ? +m[1].replace(/,/g, '') : null;
R.desktop.S_seaDrawn = await page.evaluate(() => window.__qts.S.seaDrawn); R.desktop.S_seaBytes = await page.evaluate(() => window.__qts.S.seaBytes); R.desktop.D_N = await page.evaluate(() => window.__qts.D.N);
R.desktop.hud_count_equals_lines_bin = R.desktop.hud_point_count === R.lines_bin_entries && R.desktop.S_seaDrawn === R.lines_bin_entries;
R.desktop.hud_fps_line = (await hudLines(page)).find(l => l.startsWith('fps')) || null;
log('HUD count', R.desktop.hud_point_count, 'S.seaDrawn', R.desktop.S_seaDrawn, 'VBO bytes', R.desktop.S_seaBytes, 'lines.bin/4', R.lines_bin_entries, '→', R.desktop.hud_count_equals_lines_bin);
// (4) fps over 3 s via rAF
R.desktop.fps_3s = await measureFps(page); log('fps 1440:', JSON.stringify(R.desktop.fps_3s));
// (5) scrollWidth
R.desktop.scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); R.desktop.innerWidth = await page.evaluate(() => innerWidth); log('scrollWidth 1440:', R.desktop.scrollWidth);
// (8) Bloch drag on the default focus atom (before any measurement)
const focus0 = await page.evaluate(() => { const S = window.__qts.S; return { atom: S.atom ? { n: S.atom.n, name: S.atom.name, shells: S.atom.shells } : null, theta: S.theta, phi: S.phi, dataTheta: S.dataTheta }; });
const hb = await page.$eval('#sphereHandle', e => { const r = e.getBoundingClientRect(); return { x: r.x, y: r.y, w: r.width, h: r.height }; });
const hx = hb.x + hb.w / 2, hy = hb.y + hb.h / 2;
const topAt = (x, y) => page.evaluate((x, y) => { const e = document.elementFromPoint(x, y); return e ? e.id || e.className || e.tagName : null; }, x, y);
R.desktop.bloch = { focus_before: focus0, handle_rect: hb, element_at_handle_centre: await topAt(hx, hy) };
await page.mouse.move(hx, hy); await page.mouse.down();
for (let i = 1; i <= 10; i++) { await page.mouse.move(hx + 4 * i, hy - 3 * i); await sleep(20); }
const mid = await page.evaluate(() => { const S = window.__qts.S; const th = S.hand ? S.hand.theta : S.theta, ph = S.hand ? S.hand.phi : S.phi; const a2 = Math.cos(th / 2) ** 2, b2 = Math.sin(th / 2) ** 2; return { hand: !!S.hand, theta: th, phi: ph, theta_deg: th * 180 / Math.PI, phi_deg: ph * 180 / Math.PI, alpha2: a2, beta2: b2, sum: a2 + b2 }; });
const stateMid = await stateLine(page);
await page.mouse.up(); await sleep(150);
const after = await page.evaluate(() => { const S = window.__qts.S; return { hand: !!S.hand, relaxing: !!S.relaxFrom, theta: S.theta, phi: S.phi }; });
R.desktop.bloch.during_drag = mid; R.desktop.bloch.state_line_during_drag = stateMid; R.desktop.bloch.after_release = after;
R.desktop.bloch.theta_changed = Math.abs(mid.theta - focus0.theta) > 1e-6; R.desktop.bloch.phi_changed = Math.abs(mid.phi - focus0.phi) > 1e-6; R.desktop.bloch.norm_1000 = mid.sum.toFixed(3) === '1.000';
R.desktop.bloch.pass = R.desktop.bloch.theta_changed && R.desktop.bloch.phi_changed && R.desktop.bloch.norm_1000 && mid.hand;
log('bloch: before θ', focus0.theta.toFixed(4), 'φ', focus0.phi.toFixed(4), '→ during drag θ', mid.theta.toFixed(4), 'φ', mid.phi.toFixed(4), '|α|²+|β|²=', mid.sum.toFixed(6), 'hand', mid.hand, 'pass', R.desktop.bloch.pass);
await sleep(2200); // let the hand state relax back to the data θ before the click test
// (6) click a visible point in the principal star; find one whose family has a shipped atom so a Born measurement is possible
const geo = await page.evaluate(() => { const { G, DPR } = window.__qts; const r = document.querySelector('#gl').getBoundingClientRect(); return { cx: r.x + G.c0[0] / DPR, cy: r.y + G.c0[1] / DPR, R: G.R / DPR, rin: 0.5, canvas: { x: r.x, y: r.y, w: r.width, h: r.height } }; });
const bornBefore = await born(page); const tries = [];
let hit = null;
outer: for (let k = 0; k < 120; k++) {
const ang = (k * 2.399963) % (2 * Math.PI); const rad = geo.R * (0.55 + 0.42 * ((k * 0.618034) % 1));
const x = Math.round(geo.cx + Math.cos(ang) * rad), y = Math.round(geo.cy + Math.sin(ang) * rad);
if (x < geo.canvas.x + 2 || x > geo.canvas.x + geo.canvas.w - 2 || y < geo.canvas.y + 2 || y > geo.canvas.y + geo.canvas.h - 2) continue;
if ((await topAt(x, y)) !== 'gl') continue; // do not click through the HUD or the sphere handle
await page.mouse.click(x, y); await sleep(120);
const st = await page.evaluate(() => { const S = window.__qts.S, Dd = window.__qts.D; return { msg: S.msg, famIdx: S.famIdx, key: S.key, fam: S.famIdx >= 0 ? { n: Dd.families[S.famIdx].n, name: Dd.families[S.famIdx].name, lineOffset: Dd.families[S.famIdx].lineOffset, lineCount: Dd.families[S.famIdx].lineCount } : null, atom: S.atom ? { n: S.atom.n, name: S.atom.name } : null }; });
const isHit = /^(twin star: )?#\d+ · family #/.test(st.msg || '');
tries.push({ x, y, hit: isHit, msg: (st.msg || '').slice(0, 120), atom: st.atom });
if (isHit && !hit) hit = { x, y, ...st };
if (isHit && st.atom) { hit = { x, y, ...st }; break outer; }
}
R.desktop.click = { tries: tries.length, hits: tries.filter(t => t.hit).length, first_hit_with_atom: hit && hit.atom ? { x: hit.x, y: hit.y } : null, picked: hit ? { msg: hit.msg, famIdx: hit.famIdx, key: hit.key, fam: hit.fam, atom: hit.atom } : null, born_before: bornBefore, tries_log: tries.slice(0, 30) };
if (hit) {
// key from the pick exists in lines.bin at the family's own range
const inRange = keys.subarray(hit.fam.lineOffset, hit.fam.lineOffset + hit.fam.lineCount).includes(hit.key);
R.desktop.click.picked_key_in_lines_bin = keySet.has(hit.key); R.desktop.click.picked_key_in_family_range = inRange;
// lines panel
const panel = await page.evaluate(() => { const b = document.querySelector('#lines'); return { hidden: b.hidden, head: (b.querySelector('.u-h') || {}).textContent || null, keys: Array.from(b.querySelectorAll('.u-key')).map(s => +s.textContent) }; });
const fileKeys = Array.from(keys.subarray(hit.fam.lineOffset, hit.fam.lineOffset + hit.fam.lineCount));
const shown = panel.keys; const allExist = shown.every(k => keySet.has(k)); const exactPrefix = shown.length > 0 && shown.every((k, i) => fileKeys[i] === k);
R.desktop.click.lines_panel = { hidden: panel.hidden, head: panel.head, shown_count: shown.length, family_lineCount_on_disk: fileKeys.length, first_keys: shown.slice(0, 12), all_shown_keys_exist_in_lines_bin: allExist, shown_keys_equal_family_range_prefix: exactPrefix };
// the click itself: did the Born audit change (steer vs measure)?
const bornAfterClick = await born(page); R.desktop.click.born_after_click = bornAfterClick; R.desktop.click.click_alone_measured = bornAfterClick !== bornBefore;
// then the measure button (Born rule on the focused atom, if the family has one)
if (hit.atom) {
const b0 = await born(page); await page.click('#measure'); await sleep(300); const b1 = await born(page); const st = await stateLine(page);
const rec = await page.evaluate(() => Array.from(document.querySelectorAll('#record button')).map(b => b.textContent));
const S2 = await page.evaluate(() => { const S = window.__qts.S; return { outcome: S.outcome, theta: S.theta, measuredTheta: S.measuredTheta, twinNote: S.twinNote, measurements: S.measurements.length }; });
R.desktop.click.measure = { born_before: b0, born_after: b1, changed: b0 !== b1, is_measurement: /^Born audit: measured #\d+/.test(b1 || ''), state_line: st, record_chips: rec, S: S2 };
log('measure after click:', b1);
}
log('click:', JSON.stringify({ tries: tries.length, picked: R.desktop.click.picked && R.desktop.click.picked.msg, keyInBin: R.desktop.click.picked_key_in_lines_bin, inRange, panel: R.desktop.click.lines_panel && { shown: R.desktop.click.lines_panel.shown_count, allExist, exactPrefix } }));
} else log('click: no point hit in', tries.length, 'tries');
R.desktop.click.pass = !!(hit && hit.atom && R.desktop.click.measure && R.desktop.click.measure.is_measurement && R.desktop.click.lines_panel.all_shown_keys_exist_in_lines_bin && R.desktop.click.lines_panel.shown_count > 0);
// (7) search #80299
const bornS0 = await born(page);
await page.click('#search', { clickCount: 3 }); await page.keyboard.type('#80299'); await page.keyboard.press('Enter'); await sleep(250);
const s1 = await page.evaluate(() => { const S = window.__qts.S, Dd = window.__qts.D; return { msg: S.msg, famIdx: S.famIdx, fam: S.famIdx >= 0 ? { n: Dd.families[S.famIdx].n, name: Dd.families[S.famIdx].name, lineCount: Dd.families[S.famIdx].lineCount } : null, atom: S.atom ? { n: S.atom.n, name: S.atom.name } : null, famJoinNote: S.famJoinNote, outcome: S.outcome }; });
const st1 = await stateLine(page); const born1 = await born(page);
await page.keyboard.press('Enter'); await sleep(250);
const s2 = await page.evaluate(() => { const S = window.__qts.S; return { msg: S.msg, outcome: S.outcome, collapse: !!S.collapse, measurements: S.measurements.length }; });
const born2 = await born(page); const st2 = await stateLine(page);
await page.click('#measure'); await sleep(250); const s3 = await page.evaluate(() => { const S = window.__qts.S; return { msg: S.msg, outcome: S.outcome, measurements: S.measurements.length }; }); const born3 = await born(page);
const panel80299 = await page.evaluate(() => { const b = document.querySelector('#lines'); return { hidden: b.hidden, head: (b.querySelector('.u-h') || {}).textContent || null, keys: Array.from(b.querySelectorAll('.u-key')).map(s => +s.textContent) }; });
const f80299 = R.family_80299; const fileKeys80299 = f80299 ? Array.from(keys.subarray(f80299.lineOffset, f80299.lineOffset + f80299.lineCount)) : [];
R.desktop.search_80299 = { born_before: bornS0, after_first_enter: { S: s1, state_line: st1, born: born1 }, after_second_enter: { S: s2, state_line: st2, born: born2 }, after_measure_button: { S: s3, born: born3 }, lines_panel: { ...panel80299, keys_on_disk: fileKeys80299, match: JSON.stringify(panel80299.keys) === JSON.stringify(fileKeys80299) }, steered_to_haversine: !!(s1.fam && s1.fam.n === … [line shortened here: 680 characters; full line on GitHub]
log('search #80299: first Enter →', s1.msg); log(' atom:', JSON.stringify(s1.atom), 'famJoinNote:', s1.famJoinNote); log(' second Enter →', s2.msg); log(' measure button →', s3.msg); log(' Born audit after:', born3);
// (10) screenshot 1440
await page.screenshot({ path: DIR + '/proof/verify-2-1440.png' }); log('wrote verify-2-1440.png');
R.desktop.console_total = { all: D.con.length, errors: D.con.filter(c => c.type === 'error').map(c => c.text), warnings: D.con.filter(c => c.type === 'warning' || c.type === 'warn').map(c => c.text), pageerrors: D.errs, external_requests_total: D.external };
await page.close();
// =================== PHONE 430x900 ===================
const P = await openPage(430, 900, 'phone'); const pp = P.page; R.phone = { readyMs: P.readyMs };
log('phone page ready in', P.readyMs, 'ms');
R.phone.renderer_page_S = await pp.evaluate(() => window.__qts.S.renderer);
await sleep(8000);
R.phone.console_8s = { all: P.con.length, errors: P.con.filter(c => c.type === 'error'), warnings: P.con.filter(c => c.type === 'warning' || c.type === 'warn'), pageerrors: P.errs.slice(), requestfailed: P.failed.slice(), external_requests: P.external.slice() };
const hudP = await hudText(pp); const mp = /on GPU: ([\d,]+) line entries/.exec(hudP);
R.phone.hud_point_count = mp ? +mp[1].replace(/,/g, '') : null; R.phone.S_seaDrawn = await pp.evaluate(() => window.__qts.S.seaDrawn); R.phone.phoneMode = await pp.evaluate(() => window.__qts.S.phoneMode || null);
R.phone.hud_count_equals_lines_bin = R.phone.hud_point_count === R.lines_bin_entries && R.phone.S_seaDrawn === R.lines_bin_entries;
R.phone.fps_3s = await measureFps(pp); log('fps 430:', JSON.stringify(R.phone.fps_3s));
R.phone.scrollWidth = await pp.evaluate(() => document.documentElement.scrollWidth); R.phone.innerWidth = await pp.evaluate(() => innerWidth); R.phone.bodyScrollWidth = await pp.evaluate(() => document.body.scrollWidth); log('scrollWidth 430:', R.phone.scrollWidth);
R.phone.hud_position = await pp.evaluate(() => getComputedStyle(document.querySelector('#hud')).position);
R.phone.widest_elements = await pp.evaluate(() => Array.from(document.querySelectorAll('body *')).map(e => ({ id: e.id || e.tagName.toLowerCase() + (e.className ? '.' + String(e.className).split(' ')[0] : ''), right: Math.round(e.getBoundingClientRect().right) })).filter(e => e.right > 430).slice(0, 10));
await pp.screenshot({ path: DIR + '/proof/verify-2-430.png' }); log('wrote verify-2-430.png');
R.phone.console_total = { all: P.con.length, errors: P.con.filter(c => c.type === 'error').map(c => c.text), warnings: P.con.filter(c => c.type === 'warning' || c.type === 'warn').map(c => c.text), pageerrors: P.errs };
await pp.close();
} catch (e) { R.fatal = String(e && e.stack || e); log('FATAL', R.fatal); }
finally {
sampling = false; await sampler; if (browser) await browser.close().catch(() => {});
server.kill(); try { execFileSync('taskkill', ['/PID', String(server.pid), '/T', '/F'], { stdio: 'ignore' }); } catch (e) {}
await sleep(800);
let listening = ''; try { listening = execFileSync('netstat', ['-ano'], { encoding: 'utf8' }).split('\n').filter(l => l.includes(`:${PORT} `) && l.includes('LISTENING')).join('\n').trim(); } catch (e) {}
R.server_stopped = listening === ''; R.server_listen_after_stop = listening;
}
R.gpu_live = stats(live); log('live', JSON.stringify({ ...R.gpu_live, samples: undefined }));
R.gpu_live_first_10 = R.gpu_live.samples.slice(0, 10);
// ---- verdict ----
const rend = (R.desktop && R.desktop.renderer_fresh_context) || '';
R.criteria = {
c1_renderer_names_gpu: /NVIDIA|GeForce|Radeon|Intel\(R\)|Arc/.test(rend) && !/SwiftShader|llvmpipe|Software/i.test(rend),
c2_no_console_errors: !!(R.desktop && R.desktop.console_8s.errors.length === 0 && R.desktop.console_8s.pageerrors.length === 0 && R.phone && R.phone.console_8s.errors.length === 0 && R.phone.console_8s.pageerrors.length === 0),
c3_hud_count_matches_lines_bin: !!(R.desktop && R.desktop.hud_count_equals_lines_bin),
c5_scrollWidth_430: !!(R.phone && R.phone.scrollWidth === 430),
c6_click_then_measurement: !!(R.desktop && R.desktop.click && R.desktop.click.pass),
c7_haversine_80299_born_measured: !!(R.desktop && R.desktop.search_80299 && R.desktop.search_80299.haversine_born_measured),
c7_haversine_80299_steered: !!(R.desktop && R.desktop.search_80299 && R.desktop.search_80299.steered_to_haversine),
c8_bloch_drag: !!(R.desktop && R.desktop.bloch && R.desktop.bloch.pass),
};
R.pass_strict = Object.entries(R.criteria).filter(([k]) => !k.endsWith('_steered')).every(([, v]) => v);
R.finished_utc = new Date().toISOString();
fs.writeFileSync(DIR + '/proof/verify-2.json', JSON.stringify(R, null, 2));
log('criteria', JSON.stringify(R.criteria)); log('PASS (strict wording):', R.pass_strict); log('wrote proof/verify-2.json');