GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Websites and apps / globalgrid2050 / ventus/wiring

GlobalGrid2050 IP and MAC Addresses — App and 5 more files

A JavaScript file in the assets folder that validates config (`validateConfig`) and shows record (`showRecord`). It validates config (`validateConfig`), renders list (`renderList`) and shows record (`showRecord`).

606 lines of JavaScript and HTML and Python from globalgrid2050, globalgrid2050-homepage, globalgrid2050-ip-and-mac-addresses and 1 more, in 6 files. Topic: Websites and apps. Section 1991 of 2044.

Cut 2026-12-06T03:07:51+00:00. A copy for reading; the repository at the stated commit is the source.

In the State lines below, domain stage, users and canonical status are rule-based first approximations from code and path evidence (rules explore-agent-rules-v1), not observed facts: the rules.

In this section

  1. Renderer render · globalgrid2050 / ventus/wiring/renderer.html lines 701–829
  2. Active Pages docs-config · globalgrid2050-homepage / config/active-pages.yaml lines 1–83
  3. GlobalGrid2050 IP and MAC Addresses — App interaction · globalgrid2050-ip-and-mac-addresses / assets/app.js lines 1–177
  4. GlobalGrid2050 IP and MAC Addresses — Style Sheet render · globalgrid2050-ip-and-mac-addresses / assets/style.css lines 1–53
  5. GlobalGrid2050 IP and MAC Addresses — Index Page render · globalgrid2050-ip-and-mac-addresses / index.html lines 1–41
  6. Bench storage · gpu-drivers-for-global-grid / cuda-maths/layout-bench/bench.py lines 1–123

Renderer

A web page in the wiring folder of GlobalGrid2050 that draws programs. Published at https://globalgrid2050.com/ventus/wiring/renderer.html. It builds link (`buildLink`) and parses link (`parseLink`).

Set aside from the main view: 97% of its lines are the same as kuiper-grid/drawing/renderer.html (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 97% of lines shared with Renderer; read that one first. All set-aside files, with reasons. Nothing was deleted.

Evidence
  • line-jaccard 0.9748 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 kuiper-grid/drawing/renderer.html:1-829 e8e2d6ef52f7b28f3ff4e46202e23baed4214907
  • sha256 5c994fad2c8307244b5d15d630d94242cf3cc8e492c24057cacde14c977e9fa8
  • target sha256 5ba9e9f8c920be44cd0fca55f14b0ae31b13530e90b44f8c198a7e38446beee5
  • group of 3 (identity.json near-copy edges >= 0.9)
  • canonical rule: reachable, newest stamp, core repo, most lines

renderglobalgrid2050 / ventus/wiring/renderer.html · lines 701–829 of 829 (continued from section 1990) · Entry point · pattern frameOnce (shared by 6 files)

What it does
It draws programs. Defines 34 functions or classes, including buildLink, complaints, parseLink, fmt, day. Side effects: changes the web page (DOM); makes network requests.
Inputs & outputs
In: JSON file programs.json; form fields (user input). Out: web page; WebGL/WebGPU drawing.
Downstream impact
It is itself an entry point, published at https://globalgrid2050.com/ventus/wiring/renderer.html.
What it achieves
Defines `buildLink`, `complaints`, `parseLink` and 30 more. It reads `cosmos/programs.json`. It responds to error, webglcontextlost and resize events.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · ventus/wiring · page
Uses
Ventus Card (script src), Ventus Programs (script src), Ventus Pointer (script src), Ventus Controls (script src), Ventus Chrome (script src), Public Start (script src)
Used by
none found
Produces
buildLink, complaints, parseLink, fmt, day, words, prog, U, tsv, boot, appFor, narrow
Defines here
edge
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 ventus/wiring/renderer.html:701-829 · blob a40b71942ce3f67d9358ad53bb9a299a40ca6546 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, network · domain stage: unknown · users: none · canonical: production_core
    gl.finish(); ms = performance.now() - t0; }

  if (iso && body && body.shown && BP) {
    gl.useProgram(BP); gl.disable(gl.BLEND);
    gl.bindBuffer(gl.ARRAY_BUFFER, bodyBuf); const at = gl.getAttribLocation(BP, 'a_pos');
    gl.enableVertexAttribArray(at); gl.vertexAttribPointer(at, 2, gl.FLOAT, false, 0, 0);
    gl.uniform2f(U(BP,'u_res'), W, H); gl.uniform2f(U(BP,'u_center'), cx, cy); gl.uniform1f(U(BP,'u_zoom'), zoom);
    gl.uniform1f(U(BP,'u_size'), bodyDrawnDiameter());
    gl.uniform3f(U(BP,'u_on'), iso.prog.on.colour[0], iso.prog.on.colour[1], iso.prog.on.colour[2]);
    gl.drawArrays(gl.POINTS, 0, body.n);
    gl.disableVertexAttribArray(at); gl.bindBuffer(gl.ARRAY_BUFFER, null); }
  if (iso && glowCount && !glowOff && PG && (iso.prog.on.size || 0) > 0 && !(body && body.shown)) {
    // ADDITIVE, so sparks that fall together burn brighter, which is what a lot of work in one place
    // should look like. The state is put back exactly as it was found.
    gl.useProgram(PG); gl.enable(gl.BLEND); gl.blendFunc(gl.ONE, gl.ONE);
    gl.bindBuffer(gl.ARRAY_BUFFER, glowBuf); const at = gl.getAttribLocation(PG, 'a_pos');
    gl.enableVertexAttribArray(at); gl.vertexAttribPointer(at, 2, gl.FLOAT, false, 0, 0);
    gl.uniform2f(U(PG,'u_res'), W, H); gl.uniform2f(U(PG,'u_center'), cx, cy); gl.uniform1f(U(PG,'u_zoom'), zoom);
    gl.uniform1f(U(PG,'u_size'), iso.prog.on.size * (window.devicePixelRatio || 1)); gl.uniform1f(U(PG,'u_front'), iso.front);
    gl.uniform3f(U(PG,'u_on'), iso.prog.on.colour[0], iso.prog.on.colour[1], iso.prog.on.colour[2]);
    // A DENSE BODY MUST NOT BURN OUT TO WHITE. Light adds, so thousands of sparks packed into a small
    // body on a phone summed to a featureless blob. Each spark is turned down by how crowded the body
    // is, in step with how far the gathering has gone, so the body keeps its colour and its grain.
    { const sz = iso.prog.on.size * (window.devicePixelRatio || 1), Rp = Math.sqrt(SPACE) * zoom * GATHER_RADIUS;
      const crowd = Math.max(1, glowCount * sz * sz * 0.10 / Math.max(1, Math.PI * Rp * Rp));
      const g = iso.to ? (iso.g === undefined ? 1 : iso.g) : 0;
      gl.uniform1f(U(PG,'u_bright'), (iso.prog.on.bright || 1) / (1 + g * (crowd - 1))); }
    gl.drawArrays(gl.POINTS, 0, glowCount);
    gl.disableVertexAttribArray(at); gl.bindBuffer(gl.ARRAY_BUFFER, null); gl.disable(gl.BLEND); }
  const L = [], D = [];
  D.push(points ? 'RESOLVED · every issued key whose radius is in the field, drawn at its own place'
                : 'UNRESOLVED · up to ' + words(1/(Math.PI*zoom*zoom)) + ' keys to a pixel · each pixel’s issued count is computed from the law, not drawn');
  if (points) D.push(fmt(total) + ' issued keys from ' + fmt(segs.length) + ' commits passed to the GPU in ' + ms.toFixed(0) + ' ms');
  D.push('the whole · ' + fmt(N) + ' issued + ' + fmt(SPACE - N) + ' silent = ' + fmt(SPACE) + ' addresses');
  if (iso) L.push('ISOLATED \u00b7 ' + iso.app.button + ' \u00b7 ' + fmt(iso.lit) + ' pieces of work lit \u00b7 '
    + fmt(iso.dark) + ' dark \u00b7 ' + day(iso.first) + ' to ' + day(iso.last));
  if (litRepo >= 0) { const rt = linesByRunningTotals(litRepo), rr = repos[litRepo];
    // the number on screen is the one the shading is made of, not the one the belt declared; if
    // they differ the HUD says so rather than picking the prettier of the two
    // WHAT IS HIGHLIGHTED, IN WORDS A READER CAME WITH. Whether two running totals agree is how
    // this page knows it is not lying, which matters, and belongs where the rest of the working
    // is: behind d. What stays on the face is the disagreement itself, if there ever is one,
    // because a reader must never be shown a number the page has reason to doubt.
    L.push('HIGHLIGHTED · ' + rr.name + ' · ' + fmt(rr.commits) + ' pieces of work · '
           + day(rr.t0) + ' to ' + day(rr.t1));
    D.push('running totals ' + (rt === rr.lines ? 'agree with the belt' : 'DISAGREE with the belt'));
    if (rt !== rr.lines) L.push('THIS COUNT IS IN DOUBT · two measurements of it disagree, so it is not shown');
    const wpx = widestRunPx(litRepo, zoom);
    // Said exactly, because 269 pixels of a repository whose widest run is a tenth of a pixel are
    // lit: the runs are so close together that pixel centres keep landing inside them. The claim
    // is about the run, not about the light.
    if (wpx < 1) L.push('TOO SMALL TO SEE AT THIS ZOOM · what is lit is only where this work happens to fall · zoom in to see it whole'); }
  D.push(zoom >= 1 ? 'zoom ' + zoom.toFixed(1) + ' px per key spacing' : 'zoom 1 px = ' + words(1/zoom) + ' units');
  hud.textContent = (detail ? L.concat(D) : L).join('\n');
  // A PANEL DRAWN FOR WORDS THAT ARE NOT THERE. With nothing highlighted the readout is empty, and
  // an empty bordered box sat in the corner at 1366 looking like something that had failed to load.
  hud.style.display = hud.textContent.trim() ? '' : 'none';
  o2.clearRect(0,0,ov.width,ov.height);
  { const x0 = (0 - cx)*zoom + ov.width/2, y0 = ov.height/2 + cy*zoom, M = ['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'];
    const a = new Date(commits[0].unix*1000), b = new Date(commits[commits.length-1].unix*1000); let lastPx = -99;
    o2.font = '10px ui-monospace,Consolas,monospace'; o2.lineWidth = 1;
    for (let y = a.getUTCFullYear(), m = a.getUTCMonth() + 1; y < b.getUTCFullYear() || (y === b.getUTCFullYear() && m <= b.getUTCMonth()); m++) {
      if (m > 11) { m = 0; y++; }
      const t = Date.UTC(y, m, 1)/1000, i = Math.min(commits.length-1, findBy('unix', t - 1) + 1), rp = Math.sqrt(commits[i].k0)*zoom;
      if (rp - lastPx < 26 || rp > 6000) continue; lastPx = rp;
      o2.strokeStyle = 'rgba(46,230,230,.30)'; o2.beginPath(); o2.arc(x0, y0, rp, 0, 6.2832); o2.stroke();
      o2.fillStyle = 'rgba(46,230,230,.85)'; o2.fillText(M[m] + ' ' + String(y).slice(2), x0 + rp*0.5 + 4, y0 - rp*0.866 - 3); } }
  if (target && target.boundary && zoom >= POINTS_FROM) {
    // at this zoom the boundary circle is straight across the screen: perpendicular to the radius
    const x = (target.x - cx)*zoom + ov.width/2, y = ov.height/2 - (target.y - cy)*zoom, rr = Math.hypot(target.x, target.y) || 1;
    const tx = -target.y/rr, ty = target.x/rr, Lp = Math.hypot(ov.width, ov.height);
    o2.strokeStyle = 'rgba(255,199,107,.95)'; o2.lineWidth = 2; o2.setLineDash([10,6]); o2.beginPath();
    o2.moveTo(x - tx*Lp, y + ty*Lp); o2.lineTo(x + tx*Lp, y - ty*Lp); o2.stroke(); o2.setLineDash([]);
    o2.font = '12px ui-monospace,Consolas,monospace'; o2.fillStyle = 'rgba(255,199,107,1)';
    // outward is newer, and which way outward points on screen depends on where this key sits, so
    // the words are placed along the real radius rather than assumed to read left to right
    const ox = target.x/rr, oy = -target.y/rr;
    o2.textAlign = 'center';
    o2.fillText('NEW CODE', x + ox*110, y + oy*110); o2.fillStyle = 'rgba(213,220,234,.85)';
    o2.fillText('older', x - ox*110, y - oy*110); o2.fillStyle = 'rgba(255,199,107,1)';
    o2.fillText('the boundary', x + tx*150, y - ty*150 - 8); o2.textAlign = 'start'; }
  if (arrow) {
    const p = keyPlace(arrow.k);
    const fx = (0 - cx)*zoom + ov.width/2, fy = ov.height/2 + cy*zoom;          // the middle: where the record begins
    const bx = (p[0] - cx)*zoom + ov.width/2, by = ov.height/2 - (p[1] - cy)*zoom;
    // WHEN THE BEGINNING IS OFF THE SCREEN, AND AFTER THE CAMERA FLIES IT ALWAYS IS, the arrow keeps
    // the true line and starts where that line crosses the edge of the window. Direction is the whole
    // of what it says; a stub of a line thousands of screen widths long says nothing at all.
    let ax = fx, ay = fy;
    { const W = ov.width, H = ov.height, dx = fx - bx, dy = fy - by;
      const far = fx < 0 || fy < 0 || fx > W || fy > H;
      if (far && (dx || dy)) {
        let t = Infinity;
        const edge = (num, den) => { if (den === 0) return; const u = num / den;
          if (u > 0 && u < t) { const x = bx + dx*u, y = by + dy*u;
            if (x >= -1 && x <= W + 1 && y >= -1 && y <= H + 1) t = u; } };
        edge(-bx, dx); edge(W - bx, dx); edge(-by, dy); edge(H - by, dy);
        if (t !== Infinity) { ax = bx + dx*t*0.98; ay = by + dy*t*0.98; }
      } }
    const u = Math.min(1, (performance.now() - arrow.t0) / ARROW_MS), e = 1 - Math.pow(1 - u, 3);
    const tx = ax + (bx - ax)*e, ty = ay + (by - ay)*e, th = Math.atan2(by - ay, bx - ax);
    o2.strokeStyle = 'rgba(255,43,214,.95)'; o2.lineWidth = 2; o2.beginPath();
    o2.moveTo(ax, ay); o2.lineTo(tx, ty);
    for (const d of [-0.36, 0.36]) { o2.moveTo(tx, ty); o2.lineTo(tx - 13*Math.cos(th + d), ty - 13*Math.sin(th + d)); }
    o2.stroke();
    // WHERE THE POINT REALLY IS, not where it was aimed. The page can be asked afterwards, and an
    // arrow that lands NEAR the answer is worse than no arrow at all, because it is believed.
    arrowTip = { x:tx, y:ty, x0:ax, y0:ay, fromX:fx, fromY:fy, done:u >= 1 };
    if (u >= 1 && !arrow.held) arrow.held = performance.now();
    if (arrow.held && performance.now() - arrow.held > ARROW_HOLD) arrow = null;     // it has said its piece
    dirty = true;
  }
  if (target) { const x = (target.x - cx)*zoom + ov.width/2, y = ov.height/2 - (target.y - cy)*zoom;
    o2.strokeStyle = 'rgba(255,43,214,.98)'; o2.lineWidth = 1.5; o2.beginPath();
    for (const [a,b,c,d] of [[-16,0,-6,0],[6,0,16,0],[0,-16,0,-6],[0,6,0,16]]) { o2.moveTo(x+a,y+b); o2.lineTo(x+c,y+d); } o2.stroke(); }
}
</script>
<script src="VENTUS-card.js"></script>
<script src="VENTUS-programs.js"></script>
<script src="VENTUS-pointer.js"></script>
<script src="VENTUS-controls.js"></script>
<script src="VENTUS-chrome.js"></script>
<script>
'use strict';
// every part has arrived: load the record and start drawing
boot(); requestAnimationFrame(frame);
</script>
<script src="public-start.js"></script></body>
</html>

Active Pages

A configuration file in the config folder of GlobalGrid2050 Homepage covering cables and uses data from the GridAtlas, GlobalGrid2050-ip-and-mac-addresses and SLD repositories.

docs-configglobalgrid2050-homepage / config/active-pages.yaml · lines 1–83 of 83 · Not reached from any entry point (candidate for review)

Why it exists in the grid workflow
Domain terms in the code: cables.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050-homepage · config · configuration
Uses
GridAtlas — Atlas Page (estate URL), GlobalGrid2050 — Kuiper Page (estate URL), Solar Battery Energy Storage System (BESS) Topology V7 — GIS Single-Line Diagram (SLD) Financial Sandbox Page (estate URL), GlobalGrid2050 IP and MAC Addresses — Index Page (estate URL)
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050-homepage@551a7625b02ddb7b3e6e0181cc643b8114c7fc06 config/active-pages.yaml:1-83 · blob 702f09c893f7a8cc4f23a33d7be09da88652b78c · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: none found · domain stage: unknown · users: none · canonical: unreached_review
{
  "format": "JSON-compatible YAML; parsed with Python standard-library json",
  "owner": "Ventusltd",
  "window_days": 30,
  "max_items": 12,
  "max_candidates": 20,
  "repository_listing_limit": 100,
  "commits_per_repository": 100,
  "max_html_bytes": 2000000,
  "exclude_repositories": [
    "globalgrid2050-homepage",
    "globalgrid2050-hompage",
    "cvaa",
    "law",
    "chatgpt-audits",
    "reports",
    "registry_of_all_content_in_repos_and_dependencies",
    "seed-data",
    "architecture",
    "youengineer-code-review"
  ],
  "exclude_repository_prefixes": [
    "data-",
    "data_"
  ],
  "exclude_commit_prefixes": [
    "chore: refresh homepage ticker",
    "chore: refresh active pages"
  ],
  "candidates": [
    {
      "repository": "gridatlas",
      "label": "GridAtlas",
      "url": "https://ventusltd.github.io/gridatlas/atlas/"
    },
    {
      "repository": "globalgrid2050",
      "label": "Kuiper",
      "url": "https://globalgrid2050.com/kuiper/"
    },
    {
      "repository": "globalgrid2050",
      "label": "Pipeline News",
      "url": "https://globalgrid2050.com/uk_renewables_pipeline/202609082224/"
    },
    {
      "repository": "globalgrid2050",
      "label": "Grid Explorer",
      "url": "https://globalgrid2050.com/solar-bess-topology-v7/gis-sld-financial-sandbox/index.html"
    },
    {
      "repository": "globalgrid2050-ip-and-mac-addresses",
      "label": "Identity Registry",
      "url": "https://ventusltd.github.io/globalgrid2050-ip-and-mac-addresses/"
    },
    {
      "repository": "sld",
      "label": "SLD Library",
      "url": "https://ventusltd.github.io/sld/"
    },
    {
      "repository": "ventus-grid-engine",
      "label": "VENTUS Grid Engine",
      "url": "https://ventusltd.github.io/ventus-grid-engine/"
    },
    {
      "repository": "globalgrid2050",
      "label": "Electricity Market Intelligence",
      "url": "https://globalgrid2050.com/uk_energy_tracking_v6/"
    },
    {
      "repository": "globalgrid2050",
      "label": "Metals & Cable Prices",
      "url": "https://globalgrid2050.com/copper_and_aluminium_prices_historic_trends/"
    },
    {
      "repository": "globalgrid2050",
      "label": "Cable Engineering",
      "url": "https://globalgrid2050.com/ac_cables_knowledge/"
    }
  ],
  "method_note": "Rank live app routes by their repository's default-branch commits in the last 30 days. Shared-repository apps share counts; this is not per-app activity. At most 100 commits are read per repository; capped counts are lower bounds and do not resolve ordering beyond the cap. Discover additional public Pages repositories from one page of at most 100 public repositories ordered by pu  … [line shortened here: 639 characters; full line on GitHub]
}

GlobalGrid2050 IP and MAC Addresses — App

A JavaScript file in the assets folder that validates config (`validateConfig`) and shows record (`showRecord`). It validates config (`validateConfig`), renders list (`renderList`) and shows record (`showRecord`).

interactionglobalgrid2050-ip-and-mac-addresses / assets/app.js · lines 1–177 of 177 · Entry point · pattern renderList (shared by 3 files)

What it does
It draws its content. Defines 9 functions or classes, including element, safeUrl, validateConfig, validate, renderList. Side effects: changes the web page (DOM); makes network requests.
Inputs & outputs
In: JSON file registry.json; JSON file config.json.
Downstream impact
Used directly by 1 file: GlobalGrid2050 IP and MAC Addresses — Index Page (globalgrid2050-ip-and-mac-addresses, https://ventusltd.github.io/globalgrid2050-ip-and-mac-addresses/). Reached from 4 other entry points, including Homepage V130 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v130.html); PR Checks Workflow (globalgrid2050-homepage); Pages Workflow (globalgrid2050-homepage).
What it achieves
Defines `element`, `safeUrl`, `validateConfig` and 6 more. It responds to error, click and input events.
Why it matters
Loaded by the page of the same name at https://ventusltd.github.io/globalgrid2050-ip-and-mac-addresses/.
Application
globalgrid2050-ip-and-mac-addresses · assets · script
Uses
none found
Used by
loaded by GlobalGrid2050 IP and MAC Addresses — Index Page (script src)
Produces
element, safeUrl, validateConfig, validate, renderList, panelMessage, showRecord, resolve, loadJson
Defines here
element, safeUrl, validateConfig, validate, renderList, panelMessage, showRecord, resolve, loadJson
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050-ip-and-mac-addresses@2ba77a48351e70648ab8d122c187a87c47d0f6fc assets/app.js:1-177 · blob 6a00c95f9702cf110c1e82f956dca0516d871c81 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, network · domain stage: unknown · users: none · canonical: unknown
(function () {
  'use strict';
  const search = document.getElementById('registrySearch');
  const status = document.getElementById('searchStatus');
  const list = document.getElementById('recordList');
  const panel = document.getElementById('recordPanel');
  const empty = document.getElementById('emptyResults');
  const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
  let records = [];
  let selectedId = null;
  let resolverBase;

  function element(tag, text, className) {
    const result = document.createElement(tag);
    if (text !== undefined) result.textContent = text;
    if (className) result.className = className;
    return result;
  }

  function safeUrl(value) {
    if (typeof value !== 'string' || /[\s\\\u0000-\u001f\u007f]/.test(value)) throw new Error('Invalid record URL');
    const authority = /^https:\/\/([^/?#]+)/i.exec(value)?.[1];
    if (!authority || authority.includes('@') || authority.includes('%')) throw new Error('Invalid record URL');
    const parsed = new URL(value);
    if (parsed.protocol !== 'https:' || parsed.username || parsed.password || parsed.port === '0') throw new Error('Invalid record URL');
    return parsed.href;
  }

  function validateConfig(config) {
    const base = safeUrl(config?.resolver_base);
    if (config.resolver_base.includes('?') || config.resolver_base.includes('#') || !config.resolver_base.endsWith('/')) throw new Error('Invalid resolver base');
    return base;
  }

  function validate(data) {
    if (data.schema !== 'globalgrid.identity.v1' || !Array.isArray(data.records)) throw new Error('Unsupported registry');
    const seen = new Set();
    data.records.forEach(record => {
      if (!record || !uuidPattern.test(record.id) || seen.has(record.id)) throw new Error('Invalid or duplicate identity');
      seen.add(record.id);
      if (!/^\d{39}$/.test(record.barcode_number) || BigInt('0x' + record.id.replaceAll('-', '')).toString().padStart(39, '0') !== record.barcode_number) throw new Error('Identity number mismatch');
      if (!['title', 'kind', 'created_at', 'updated_at'].every(key => typeof record[key] === 'string' && record[key].trim())) throw new Error('Incomplete identity');
      if (!['active', 'retired'].includes(record.status)) throw new Error('Invalid identity status');
      if (typeof record.demonstration !== 'boolean') throw new Error('Invalid demonstration flag');
      safeUrl(record.record_url);
    });
    return data.records;
  }

  function renderList() {
    const query = search.value.trim().toLocaleLowerCase();
    const matching = records.filter(record => [record.title, record.id, record.barcode_number].some(value => value.toLocaleLowerCase().includes(query)));
    const fragment = document.createDocumentFragment();
    matching.forEach(record => {
      const item = element('li');
      const link = element('a', undefined, 'record-link');
      link.href = '#id=' + record.id;
      if (record.id === selectedId) link.setAttribute('aria-current', 'true');
      link.append(element('span', record.title, 'record-name'));
      link.append(element('span', record.kind + ' · ' + record.status + (record.demonstration ? ' · demonstration' : ''), 'record-meta'));
      link.append(element('span', record.id, 'record-id'));
      item.append(link);
      fragment.append(item);
    });
    list.replaceChildren(fragment);
    empty.hidden = matching.length !== 0;
    status.textContent = matching.length + ' of ' + records.length + ' identities' + (query ? ' match your search.' : ' available.');
  }

  function panelMessage(title, message) {
    const heading = element('h2', title);
    heading.id = 'recordHeading';
    panel.replaceChildren(heading, element('p', message, 'muted'));
  }

  function showRecord(record) {
    const heading = element('h2', 'Identity record');
    heading.id = 'recordHeading';
    const badges = element('div', undefined, 'badges');
    badges.append(element('span', record.kind, 'badge'), element('span', record.status, 'badge'));
    if (record.demonstration) badges.append(element('span', 'Demonstration', 'badge badge-demo'));
    panel.replaceChildren(heading, badges, element('h3', record.title));
    if (record.demonstration) panel.append(element('p', 'Example entry for demonstrating the registry and its labels.', 'notice'));
    if (record.status === 'retired') panel.append(element('p', 'This identity is retired. Its permanent ID remains reserved and its record is retained.', 'notice'));
    const fields = element('dl', undefined, 'identity-fields');
    const address = new URL(resolverBase);
    address.hash = 'id=' + record.id;
    [
      ['Permanent ID · UUID v4', record.id],
      ['Barcode number · the same 128-bit identity', record.barcode_number],
      ['Created', record.created_at],
      ['Updated', record.updated_at],
    ].forEach(([label, value]) => fields.append(element('dt', label), element('dd', value)));
    const addressField = element('dd');
    const addressLink = element('a', address.href);
    addressLink.href = address.href;
    addressField.append(addressLink);
    fields.append(element('dt', 'Permanent record address'), addressField);
    const destination = element('dd');
    destination.append(element('span', safeUrl(record.record_url)));
    fields.append(element('dt', 'Linked record'), destination);
    panel.append(fields);
    const launch = element('a', 'Open linked record ↗', 'launch');
    launch.href = safeUrl(record.record_url);
    panel.append(launch);

    const labelArea = element('section', undefined, 'label-area');
    labelArea.append(element('h2', 'Scan this identity'));
    const frame = element('div', undefined, 'label-frame');
    const sheet = element('div', undefined, 'qr-sheet');
    const qr = element('img');
    const labelUrl = new URL('labels/' + record.id + '.svg', document.baseURI).href;
    qr.src = labelUrl;
    qr.alt = 'QR code for the permanent record address of ' + record.title;
    qr.width = 220;
    qr.height = 220;
    qr.addEventListener('error', () => {
      sheet.replaceChildren(element('p', 'The QR label is unavailable. Use the permanent record address above.', 'qr-caption'));
    });
    sheet.append(qr, element('p', record.id, 'qr-caption'));
    frame.append(sheet);
    const controls = element('div', undefined, 'label-controls');
    const pause = element('button', 'Pause frame animation', 'motion-toggle');
    pause.type = 'button';
    pause.setAttribute('aria-pressed', 'false');
    pause.addEventListener('click', () => {
      const paused = frame.classList.toggle('is-paused');
      pause.setAttribute('aria-pressed', String(paused));
      pause.textContent = paused ? 'Resume frame animation' : 'Pause frame animation';
    });
    const openLabel = element('a', 'Open QR label');
    openLabel.href = labelUrl;
    controls.append(pause, openLabel);
    labelArea.append(frame, controls, element('p', 'The QR code and white scanning area stay still. Scanning opens this identity, so you can review its linked record.', 'muted small'));
    panel.append(labelArea);
  }

  function resolve() {
    selectedId = null;
    if (!location.hash || location.hash === '#') {
      panelMessage('Choose a record', 'Select an identity from the list, or follow a scanned label to its permanent address.');
    } else {
      const match = /^#id=([^&]+)$/.exec(location.hash);
      const id = match ? match[1] : '';
      if (!uuidPattern.test(id)) {
        panelMessage('Malformed identity address', 'Use an address ending in #id= followed by a complete lowercase UUID v4. You can also search the registry above.');
      } else {
        const record = records.find(candidate => candidate.id === id);
        if (!record) panelMessage('Identity not found', 'This ID is not in the published registry. Check the label or search for the record above.');
        else {
          selectedId = id;
          showRecord(record);
        }
      }
    }
    renderList();
  }

  function loadJson(path) {
    return fetch(new URL(path, document.baseURI)).then(response => {
      if (!response.ok) throw new Error('Registry unavailable');
      return response.json();
    });
  }
  Promise.all([loadJson('data/registry.json'), loadJson('config.json')]).then(([data, config]) => {
    resolverBase = validateConfig(config);
    records = validate(data);
    search.disabled = false;
    search.addEventListener('input', renderList);
    window.addEventListener('hashchange', resolve);
    resolve();
  }).catch(error => {
    status.textContent = 'The registry could not be loaded or validated.';
    panelMessage('Registry unavailable', 'Try again later. Identity resolution requires a valid published registry.');
    console.error('Identity registry:', error.message);
  });
}());

GlobalGrid2050 IP and MAC Addresses — Style Sheet

A style sheet in the assets folder.

renderglobalgrid2050-ip-and-mac-addresses / assets/style.css · lines 1–53 of 53 · Entry point

What it does
Side effects: changes the web page (DOM).
Downstream impact
Used directly by 1 file: GlobalGrid2050 IP and MAC Addresses — Index Page (globalgrid2050-ip-and-mac-addresses, https://ventusltd.github.io/globalgrid2050-ip-and-mac-addresses/). Reached from 4 other entry points, including Homepage V130 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v130.html); PR Checks Workflow (globalgrid2050-homepage); Pages Workflow (globalgrid2050-homepage).
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name. Described from its file name only (a candidate, not yet checked against the code).
Why it matters
Loaded by the GlobalGrid2050 IP and MAC Addresses page at https://ventusltd.github.io/globalgrid2050-ip-and-mac-addresses/.
Application
globalgrid2050-ip-and-mac-addresses · assets · style sheet
Uses
none found
Used by
loaded by GlobalGrid2050 IP and MAC Addresses — Index Page (stylesheet)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050-ip-and-mac-addresses@2ba77a48351e70648ab8d122c187a87c47d0f6fc assets/style.css:1-53 · blob 004aeb11d1fa23962cd8eb1eba35481497a7356f · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: unknown
:root{color-scheme:dark;--bg:#070c0a;--panel:#0b1510;--ink:#e8f2ed;--muted:#a7bab0;--line:#283e34;--green:#85ffb0;--cyan:#8de5ff}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace}
header,main,footer{max-width:1160px;margin:auto;padding-left:28px;padding-right:28px}
header{padding-top:56px;padding-bottom:34px}
a{color:var(--green);text-underline-offset:4px;overflow-wrap:anywhere}
a:hover{color:#fff}
a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(--cyan);outline-offset:4px}
.brand{font-size:12px;letter-spacing:.1em;text-decoration:none}
.brand span{color:var(--muted)}
h1{font-size:clamp(32px,5vw,52px);line-height:1.15;letter-spacing:-.04em;font-weight:500;margin:26px 0 18px}
.intro{max-width:690px;color:var(--muted);margin:0}
h2{font-size:13px;letter-spacing:.08em;font-weight:normal;text-transform:uppercase;margin:0 0 18px}
h3{font-size:23px;line-height:1.35;font-weight:500;margin:14px 0;overflow-wrap:anywhere}
.muted{color:var(--muted)}
.small{font-size:12px}
.search-panel{margin-bottom:28px}
label{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}
input{width:100%;border:1px solid var(--line);background:var(--panel);color:var(--ink);border-radius:0;padding:14px;font:inherit}
input::placeholder{color:var(--muted);opacity:.85}
.workspace{display:grid;grid-template-columns:minmax(240px,.8fr) minmax(0,1.4fr);gap:30px}
.directory,.record-panel{min-width:0;border-top:1px solid var(--line);padding-top:20px}
.record-list{list-style:none;padding:0;margin:0}
.record-list li{border-bottom:1px solid var(--line)}
.record-link{display:block;padding:17px 12px;text-decoration:none;border-left:2px solid transparent}
.record-link:hover{background:var(--panel)}
.record-link[aria-current="true"]{background:var(--panel);border-left-color:var(--green)}
.record-name{display:block;font-size:16px;line-height:1.4}
.record-meta{display:block;margin-top:7px;color:var(--muted);font-size:11px}
.record-id{display:block;margin-top:5px;color:var(--muted);font-size:10px;overflow-wrap:anywhere}
.badges{display:flex;flex-wrap:wrap;gap:8px}
.badge{font-size:10px;letter-spacing:.06em;text-transform:uppercase;border:1px solid var(--line);padding:3px 7px;color:var(--muted)}
.badge-demo{color:#e4cb90;border-color:#5d5134}
.notice{border-left:2px solid #8e7849;padding:8px 12px;color:#e4cb90;font-size:12px}
.identity-fields{margin:22px 0}
.identity-fields dt{font-size:11px;color:var(--muted);margin-top:16px}
.identity-fields dd{margin:4px 0 0;font-size:13px;overflow-wrap:anywhere}
.launch{display:inline-block;border:1px solid #47755a;padding:10px 15px;text-decoration:none}
.launch:hover{background:#11291c}
.label-area{margin-top:30px;padding-top:22px;border-top:1px solid var(--line)}
.label-frame{display:inline-block;max-width:100%;padding:10px;border:1px solid #47755a;animation:label-surround 7s ease-in-out infinite}
.qr-sheet{background:#fff;color:#000;padding:18px;width:256px;max-width:100%}
.qr-sheet img{display:block;width:220px;max-width:100%;height:auto;aspect-ratio:1;background:#fff}
.qr-caption{font-size:10px;line-height:1.5;margin:12px 0 0;overflow-wrap:anywhere}
.label-controls{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:16px 0;font-size:11px}
button{font:inherit;color:var(--green);background:transparent;border:1px solid #47755a;padding:6px 10px;cursor:pointer}
.label-frame.is-paused{animation:none}
@keyframes label-surround{0%,100%{border-color:#47755a;box-shadow:0 0 0 0 #85ffb000}50%{border-color:#71917c;box-shadow:0 0 14px 0 #85ffb015}}
@media(prefers-reduced-motion:reduce){.label-frame{animation:none}.motion-toggle{display:none}}
footer{border-top:1px solid var(--line);margin-top:46px;padding-top:24px;padding-bottom:32px;font-size:11px;color:var(--muted)}
footer p{margin:0 0 6px}
@media(max-width:720px){.workspace{grid-template-columns:1fr;gap:30px}header{padding-top:32px}.brand span{display:block;margin-top:5px}.record-panel{padding-top:24px}header,main,footer{padding-left:20px;padding-right:20px}}

GlobalGrid2050 IP and MAC Addresses — Index Page

A web page that reads inputs for registry. Published at https://ventusltd.github.io/globalgrid2050-ip-and-mac-addresses/.

renderglobalgrid2050-ip-and-mac-addresses / index.html · lines 1–41 of 41 · Entry point

What it does
It draws its content. Side effects: changes the web page (DOM).
Inputs & outputs
In: JSON file registry.json; form fields (user input). Out: web page.
Downstream impact
Used directly by 3 files: Homepage Browser (globalgrid2050-homepage); Homepage V130 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v130.html); Active Pages (globalgrid2050-homepage). Reached from 2 other entry points, including PR Checks Workflow (globalgrid2050-homepage); Pages Workflow (globalgrid2050-homepage). It is itself an entry point, published at https://ventusltd.github.io/globalgrid2050-ip-and-mac-addresses/.
What it achieves
Find a GlobalGrid asset by its permanent identity and open its linked record.
Why it matters
Loaded by the Homepage V130 page in GlobalGrid2050 at https://globalgrid2050.com/homepage_versions/homepage_v130.html. Also imported by Active Pages, from GlobalGrid2050 Homepage. Checked by Homepage Browser.
Application
globalgrid2050-ip-and-mac-addresses · / · page
Uses
GlobalGrid2050 IP and MAC Addresses — Style Sheet (stylesheet), GlobalGrid2050 IP and MAC Addresses — App (script src)
Used by
named by URL in Homepage Browser (estate URL), linked from Homepage V130 (link), named by URL in Active Pages (estate URL)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050-ip-and-mac-addresses@2ba77a48351e70648ab8d122c187a87c47d0f6fc index.html:1-41 · blob a16dfa7926ffee6c3cf03a9bad81bf83c38ab652 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: unknown
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Find a GlobalGrid asset by its permanent identity and open its linked record.">
  <title>GlobalGrid2050 · Identity registry</title>
  <link rel="stylesheet" href="assets/style.css">
  <script defer src="assets/app.js"></script>
</head>
<body>
  <header>
    <a class="brand" href="./">GLOBALGRID2050 <span>/ IDENTITY REGISTRY</span></a>
    <h1>One identity.<br>A record you can find.</h1>
    <p class="intro">Search a title, permanent ID or barcode number. Select an entry to open its record or scan its label.</p>
  </header>
  <main>
    <section class="search-panel" aria-label="Find a record">
      <label for="registrySearch">Find an identity</label>
      <input id="registrySearch" type="search" placeholder="Title, UUID or barcode number…" autocomplete="off" spellcheck="false" disabled>
      <p id="searchStatus" class="muted small" role="status">Loading registry…</p>
    </section>
    <div class="workspace">
      <section class="directory" aria-labelledby="directoryHeading">
        <h2 id="directoryHeading">Registered identities</h2>
        <ul id="recordList" class="record-list"></ul>
        <p id="emptyResults" class="muted" hidden>No identities match this search.</p>
      </section>
      <section id="recordPanel" class="record-panel" aria-labelledby="recordHeading" aria-live="polite">
        <h2 id="recordHeading">Choose a record</h2>
        <p class="muted">Select an identity from the list, or follow a scanned label to its permanent address.</p>
      </section>
    </div>
    <noscript><p class="notice">JavaScript is required to search and resolve identities. You can inspect the <a href="data/registry.json">registry file</a> directly.</p></noscript>
  </main>
  <footer>
    <p>UUIDs identify records. They are not network IP addresses or hardware MAC addresses.</p>
    <p>Demonstration entries are labelled. Linked records open only when you choose their link.</p>
  </footer>
</body>
</html>

Bench

A Python command-line tool in the layout bench folder of GPU Drivers for Global Grid that reads cages.

storagegpu-drivers-for-global-grid / cuda-maths/layout-bench/bench.py · lines 1–123 of 123 · Entry point · pattern sampler (shared by 4 files)

What it does
It loads cages. Defines sampler, cpu_total, main. Uses libraries json, os, subprocess, sys, threading. Side effects: reads or writes files; starts processes.
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'layout'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
Inputs & outputs
In: JSON file graph.json; JSON file cages.json. Out: JSON file.
Downstream impact
It is itself an entry point (Python CLI); no other file was found loading it.
What it achieves
It is built from the sampler step (`sampler`) and the cpu total helper (`cpu_total`). Driver: verify the batched scorer against the CPU scorer, then measure it.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
gpu-drivers-for-global-grid · cuda-maths/layout-bench · Python CLI
Uses
GPU Score (import), json, os, subprocess, sys, threading, time, numpy, tubelib
Used by
none found
Produces
sampler, cpu_total, main
Defines here
sampler, cpu_total, main
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
gpu-drivers-for-global-grid@6c47912a8dde251ffebd92ff129e6a0c11c4ebfe cuda-maths/layout-bench/bench.py:1-123 · blob 9ba5558f3c2393e6f281ec804acf1d1c933447db · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, process · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: supporting_data
"""Driver: verify the batched scorer against the CPU scorer, then measure it."""
import json
import os
import subprocess
import sys
import threading
import time

import numpy as np

HERE = os.path.dirname(os.path.abspath(__file__))
TUBE = r"(local path removed)"
sys.path.insert(0, TUBE)
import tubelib as T           # noqa: E402
import layout_search as L     # noqa: E402

import gpu_score as G         # noqa: E402
xp = G.xp
BACKEND = G.BACKEND

_stop = threading.Event()
_s = []


def sampler():
    while not _stop.is_set():
        try:
            o = subprocess.run(["nvidia-smi", "--query-gpu=power.draw,utilization.gpu,memory.used",
                                "--format=csv,noheader,nounits"], capture_output=True,
                               text=True, timeout=10).stdout.strip().splitlines()[0]
            _s.append([float(x) for x in o.split(",")])
        except Exception:
            pass
        _stop.wait(2.0)


def cpu_total(windows, idx):
    p, r, lo, co, ox, oy, hp, sm = L.decode(idx)
    return sum(L.score_window(w, p, r, lo, co, ox, oy, hp, sm) for w in windows)


def main():
    g = T.jload(os.path.join(T.OUT, "graph.json"))
    cg = T.jload(os.path.join(T.OUT, "cages.json"))
    windows = L.build_windows(g, cg)
    groups = G.pack_windows(windows)
    out = {"backend": BACKEND, "windows": len(windows)}

    # ---- correctness: 2,000 points on the same coprime stride the search uses
    N = int(os.environ.get("N_VERIFY", "2000"))
    idxs = [(j * G.STRIDE) % G.SPACE for j in range(N)]
    t0 = time.time()
    cpu = [cpu_total(windows, i) for i in idxs]
    t_cpu_ref = time.time() - t0
    gpu = xp.asnumpy(G.score_batch(xp.asarray(np.array(idxs, np.int64)), groups)) \
        if BACKEND == "cupy" else np.asarray(G.score_batch(np.array(idxs, np.int64), groups))
    eq = (np.array(cpu, np.int64) == gpu)
    bad = [{"index": int(idxs[k]), "cpu": int(cpu[k]), "batched": int(gpu[k])}
           for k in np.nonzero(~eq)[0][:5]]
    out["verify"] = {"points": N, "equal": int(eq.sum()), "differ": int((~eq).sum()),
                     "counterexamples": bad,
                     "single_point_cpu_ref_s": round(t_cpu_ref, 2)}
    verified = int((~eq).sum()) == 0

    # ---- throughput
    if BACKEND == "cupy":
        th = threading.Thread(target=sampler, daemon=True)
        th.start()
    sizes = [int(v) for v in os.environ.get("BATCHES", "4096,16384,65536").split(",")]
    secs = float(os.environ.get("BENCH_SECONDS", "20"))
    runs = []
    for bs in sizes:
        base = np.arange(bs, dtype=np.int64) * G.STRIDE % G.SPACE
        try:
            a = xp.asarray(base)
            G.score_batch(a, groups)           # warm up / compile
            if BACKEND == "cupy":
                xp.cuda.runtime.deviceSynchronize()
        except Exception as e:
            runs.append({"batch": bs, "error": type(e).__name__ + ": " + str(e)[:160]})
            continue
        t0 = time.time(); n = 0; k = 0
        while time.time() - t0 < secs:
            # include host->device transfer of the parameter indices every time
            arr = xp.asarray((base + k * bs * G.STRIDE) % G.SPACE)
            res = G.score_batch(arr, groups)
            if BACKEND == "cupy":
                res_h = xp.asnumpy(res)        # include device->host of the scores
            else:
                res_h = res
            n += bs; k += 1
        if BACKEND == "cupy":
            xp.cuda.runtime.deviceSynchronize()
        el = time.time() - t0
        runs.append({"batch": bs, "seconds": round(el, 2), "points": n,
                     "layout_evals": n * len(windows),
                     "points_per_s": round(n / el, 1),
                     "layout_evals_per_s": round(n * len(windows) / el, 1),
                     "verified": verified})
    if BACKEND == "cupy":
        _stop.set(); time.sleep(0.1)
        if _s:
            out["gpu_samples"] = {"n": len(_s),
                                  "watts_mean": round(sum(x[0] for x in _s) / len(_s), 1),
                                  "watts_max": round(max(x[0] for x in _s), 1),
                                  "util_pct_mean": round(sum(x[1] for x in _s) / len(_s), 1),
                                  "mem_used_MiB_max": round(max(x[2] for x in _s), 0)}
            best = max((r for r in runs if "layout_evals_per_s" in r),
                       key=lambda r: r["layout_evals_per_s"], default=None)
            if best:
                out["evals_per_watt_second"] = round(
                    best["layout_evals_per_s"] / out["gpu_samples"]["watts_mean"], 1)
    out["runs"] = runs
    json.dump(out, open(os.path.join(HERE, "bench-%s.json" % BACKEND), "w"), indent=1)
    print(json.dumps(out, indent=1)[:2600])
    print(json.dumps({"check": "gpu-bench", "cases": N, "passed": int(eq.sum()),
                      "failed": int((~eq).sum()), "counterexamples": bad,
                      "seconds": round(time.time() - t0, 3)}, separators=(",", ":")))
    return 0 if verified else 1


if __name__ == "__main__":
    sys.exit(main())