From 8a9ff9b390e5ef5b3fe1b1d5226ec4bea4f60ea3 Mon Sep 17 00:00:00 2001 From: RunTimeAdmin <248247024+RunTimeAdmin@users.noreply.github.com> Date: Sun, 15 Nov 2026 15:26:28 -0600 Subject: [PATCH] Reuse pair hashes when matching a root, and page the Agents table and lobby Findings 5 and 10 of the 15 November performance review, site part. matchRoot built a whole tree for every candidate cut-off with the BigInt keccak in did.js, so Check evidence froze the page for seconds on a long payment list. It now shares one pair memo across the trees of a call, skips a cut-off that keeps the same payments as the one before, and takes the leaves agents.js has already built. Its answers are unchanged. At 1,000 payments under node, a root 10 payments behind is found in 0.33 s instead of 3.9 s, and a root no reading reproduces is ruled out in 0.47 s instead of 18.2 s. The Agents table lists agents in the order they registered, 50 to a page, and reads the chain only for the agents on screen, since an order by score needs every agent read first. The lobby, flat and 3D, holds the first 60 agents to register and no longer updates seated walkers every frame. slashes.html keeps explorer.js?v=scores1, because another branch is changing that page. Co-Authored-By: Claude Opus 5.5 --- oracle/explorer-merkle.test.js | 31 ++++++++++ oracle/site-pages.test.js | 43 +++++++++++++ site/agents.html | 10 +-- site/assets/agents.js | 109 ++++++++++++++++++++++++--------- site/assets/explorer.js | 36 ++++++++--- site/assets/lobby-scene.js | 5 +- site/assets/lobby.js | 3 + site/epochs.html | 2 +- site/integrate.html | 2 +- site/operators.html | 2 +- site/simulation.html | 2 +- site/status.html | 2 +- 12 files changed, 196 insertions(+), 51 deletions(-) diff --git a/oracle/explorer-merkle.test.js b/oracle/explorer-merkle.test.js index 71eafdb6..3805e54f 100644 --- a/oracle/explorer-merkle.test.js +++ b/oracle/explorer-merkle.test.js @@ -11,6 +11,7 @@ const { ethers } = require('ethers'); const merkle = require('./merkle'); const { evidenceAsOf } = require('./evidence-as-of'); const explorer = require('../site/assets/explorer.js'); +const did = require('../site/assets/did.js'); const T0 = 1_700_000_000; @@ -114,6 +115,36 @@ test('matchRoot says so when no reading reproduces the root', () => { assert.equal(explorer.matchRoot(list, 'not a root'), null); }); +test('matchRoot hashes each pair once across its cut-offs, so a root 10 payments behind a long list is found quickly', (t) => { + // Built here rather than by stored(), whose random wallet is slow a thousand times over. + const events = Object.freeze(Array.from({ length: 1000 }, (_, i) => Object.freeze({ + txHash: ethers.hexlify(ethers.randomBytes(32)), + payer: ethers.hexlify(ethers.randomBytes(20)), + amount: String(10n ** 18n * BigInt(i + 1)), + ts: (T0 + i * 60) * 1000, + success: [true, false, null][i % 3], + }))); + const list = events.map(served); + const committed = merkle.rootFor(events.slice(0, 990)); + // The oracle's leaves, which the first test holds to the browser's, passed as agents.js passes the + // ones it has built, so what is counted below is the trees alone. + const leaves = events.map((e) => merkle.leafFor(e)); + const keccak = did.keccak256; + let pairs = 0; + // Two 32-byte nodes are the only thing matchRoot hashes from exactly 64 bytes. + t.mock.method(did, 'keccak256', (bytes) => { if (bytes.length === 64) pairs++; return keccak(bytes); }); + + const found = explorer.matchRoot(list, committed, { leaves }); + assert.ok(found, 'found by trying each settlement time'); + assert.equal(found.events.length, 990); + assert.equal(found.cut, list[989].settledAt); + assert.equal(found.unset, false); + assert.deepEqual(found.leaves, leaves.slice(0, 990)); + // The cut-offs run from all 1,000 payments down to 990. Built one by one, those trees take about + // 12,000 pairs; sharing them, one tree's 999 and the few each later cut-off changes. + assert.ok(pairs < 1300, `${pairs} pairs hashed`); +}); + test('verifyEvidence calldata is what the contract ABI encodes', () => { const iface = new ethers.Interface(['function verifyEvidence(bytes32 didHash, bytes32 leaf, bytes32[] proof)']); const did = ethers.hexlify(ethers.randomBytes(32)); diff --git a/oracle/site-pages.test.js b/oracle/site-pages.test.js index 5c2b734c..ea6fdf61 100644 --- a/oracle/site-pages.test.js +++ b/oracle/site-pages.test.js @@ -9,6 +9,8 @@ const path = require('node:path'); const vm = require('node:vm'); const explorer = require('../site/assets/explorer.js'); const demo = require('../site/assets/demo.js'); +const did = require('../site/assets/did.js'); +const lobby = require('../site/assets/lobby.js'); test('the demo does not number blocks from the start again after the log is cleared', () => { const sim = new demo.Simulator(null); @@ -42,3 +44,44 @@ test('a Suspended or PendingBond simulated agent with stake is not shown as Acti assert.deepEqual([...ctx.statusOf(agent(3), 0)], ['waiting', 'Not bonded yet']); assert.deepEqual([...ctx.statusOf(agent(0), 0)], ['live', 'Active']); }); + +test('the agents page reads the chain only for the agents it shows, 50 rows at a time and 60 in the lobby', async () => { + const source = fs.readFileSync(path.join(__dirname, '..', 'site', 'assets', 'agents.js'), 'utf8'); + const word = (n) => n.toString(16).padStart(64, '0'); + // 130 registrations, oldest first, as contractLogs gives them. + const logs = Array.from({ length: 130 }, (_, i) => ({ + topics: [explorer.EVENTS[0].topic, '0x' + word(i + 1), '0x' + word(0xabc), '0x' + word(0x1000 + i)], time: 1_700_000_000 + i, tx: null, + })); + const asked = []; + const X = { + ...explorer, + contractLogs: async () => ({ logs, truncated: false, tail: null }), + loadSimulation: async () => {}, + // The didHash each read is for. Every answer is zero words: an active agent with nothing yet. + ethCalls: async (calls) => { asked.push(...calls.map((c) => c.data.slice(-64))); return calls.map(() => '0x' + word(0).repeat(5)); }, + }; + let html = '', people = null, next = null; + const card = { querySelector: () => ({ set innerHTML(v) { html = v; } }), classList: { remove() {} }, scrollIntoView() {} }; + const ctx = vm.createContext({ + window: { SigvaraExplorer: X, SigvaraDid: did, SigvaraLobby: { ...lobby, startLobby: (_host, list) => { people = list; } } }, + document: { + getElementById: () => card, + addEventListener() {}, + querySelectorAll: (sel) => (sel === '[data-page]' ? [{ getAttribute: () => '1', addEventListener: (_ev, fn) => { next = fn; } }] : []), + }, + }); + vm.runInContext(source, ctx); + for (let i = 0; i < 50 && !people; i++) await new Promise(setImmediate); + + const rows = () => (html.match(/data-check="/g) || []).length; + assert.equal(people.length, 60, 'the lobby holds 60'); + assert.deepEqual([...new Set(asked)], Array.from({ length: 60 }, (_, i) => word(i + 1)), 'the first 60 agents, read once each'); + assert.equal(asked.length, 60 * 5); + assert.equal(rows(), 50); + assert.match(html, /Rows 1 to 50 of 130\./); + + await next(); + assert.equal(rows(), 50); + assert.match(html, /Rows 51 to 100 of 130\./); + assert.deepEqual([...new Set(asked.slice(300))], Array.from({ length: 40 }, (_, i) => word(i + 61)), 'only the rows not read before'); +}); diff --git a/site/agents.html b/site/agents.html index 59a815f6..077cbe9b 100644 --- a/site/agents.html +++ b/site/agents.html @@ -57,7 +57,7 @@

Agents

The lobby

Click an agent to see who it is.
-

Every agent on this deployment, for fun. A look and a nickname come only from the address, so neither says how far to trust an agent: the scores below are for that. Awake, asleep and ghost follow its status on chain: active, suspended and slashed. A dashed ring marks a simulated agent, and a prop says which kind: a lunchbox for steady, a cup for mediocre, smoke for failing, and a hoop and mask for the Sybil ring. A hard hat is Sigvara's slash drill, a flag its demo agent, and a suitcase an agent from outside. The table below lists the same agents.

+

The agents on this deployment, up to the first 60 to register, for fun. A look and a nickname come only from the address, so neither says how far to trust an agent: the scores below are for that. Awake, asleep and ghost follow its status on chain: active, suspended and slashed. A dashed ring marks a simulated agent, and a prop says which kind: a lunchbox for steady, a cup for mediocre, smoke for failing, and a hoop and mask for the Sybil ring. A hard hat is Sigvara's slash drill, a flag its demo agent, and a suitcase an agent from outside. The table below lists every agent.

@@ -86,9 +86,9 @@

Evidence check

- - - - + + + + diff --git a/site/assets/agents.js b/site/assets/agents.js index 8a720559..59dd15a7 100644 --- a/site/assets/agents.js +++ b/site/assets/agents.js @@ -20,6 +20,11 @@ function setCard(id, html) { const plural = (n, one, many = one + "s") => `${n} ${n === 1 ? one : many}`; // ---- the list ---- +// Registering costs only gas, so however many agents there are, the table shows this many at a +// time and the chain is read only for the agents on screen, in the table or in the lobby. +const PAGE_ROWS = 50; +// The most agents the lobby draws (agents.html says 60 in its note). +const LOBBY_MAX = 60; let agents = []; async function loadAgents() { @@ -32,36 +37,49 @@ async function loadAgents() { + `

You can look an agent up by address on the epochs page, which reads the chain directly.

`); } const seen = new Set(); + // In the order they registered, as the logs come. Until an agent is read from the chain, its + // operator is the one that registered it, which is what puts it in a group for the filter. agents = registrations.logs - .map((l) => ({ didHash: l.topics[1], address: X.topicAddr(l.topics[3]), time: l.time, tx: l.tx })) + .map((l) => ({ didHash: l.topics[1], operator: X.topicAddr(l.topics[2]), address: X.topicAddr(l.topics[3]), time: l.time, tx: l.tx })) .filter((a) => X.isHash(a.didHash) && X.isAddr(a.address) && !seen.has(a.didHash) && seen.add(a.didHash)); if (!agents.length) return setCard("agentsCard", "

No agent has registered on this deployment yet.

"); + lastHistory = registrations; + // The lobby's agents, which take in the table's first page. try { - const reads = await X.ethCalls(agents.flatMap((a) => [ - { to: X.IDENTITY, data: X.SEL.identities + X.pad32(a.didHash) }, - { to: X.REPUTATION, data: X.SEL.getTotalScore + X.pad32(a.didHash) }, - { to: X.REPUTATION, data: X.SEL.getEarnedScore + X.pad32(a.didHash) }, - { to: X.REPUTATION, data: X.SEL.evidenceRoots + X.pad32(a.didHash) }, - { to: X.STAKING, data: X.SEL.getStake + X.pad32(a.didHash) }, - ])); - agents.forEach((a, i) => { - const [ident, total, earned, root, stake] = reads.slice(i * 5, i * 5 + 5); - // The operator now, which a transfer can change since registration. - a.operator = X.wordAddr(ident, 0); - a.status = Number(BigInt(X.word(ident, 3))); - a.total = Number(BigInt(total)); - a.earned = Number(BigInt(earned)); - a.root = X.word(root, 0).toLowerCase(); - a.stake = BigInt(stake); - }); + await readChain(agents.slice(0, LOBBY_MAX)); } catch (e) { return setCard("agentsCard", X.failed("the agents' scores from the chain", e)); } - renderAgents(registrations); + await renderAgents(); renderLobby(); } +// What the chain says now about each agent in `list` not read yet: its operator and status, its +// two scores, its evidence root and its stake. +async function readChain(list) { + const todo = list.filter((a) => !a.read); + if (!todo.length) return; + const reads = await X.ethCalls(todo.flatMap((a) => [ + { to: X.IDENTITY, data: X.SEL.identities + X.pad32(a.didHash) }, + { to: X.REPUTATION, data: X.SEL.getTotalScore + X.pad32(a.didHash) }, + { to: X.REPUTATION, data: X.SEL.getEarnedScore + X.pad32(a.didHash) }, + { to: X.REPUTATION, data: X.SEL.evidenceRoots + X.pad32(a.didHash) }, + { to: X.STAKING, data: X.SEL.getStake + X.pad32(a.didHash) }, + ])); + todo.forEach((a, i) => { + const [ident, total, earned, root, stake] = reads.slice(i * 5, i * 5 + 5); + // The operator now, which a transfer can change since registration. + a.operator = X.wordAddr(ident, 0); + a.status = Number(BigInt(X.word(ident, 3))); + a.total = Number(BigInt(total)); + a.earned = Number(BigInt(earned)); + a.root = X.word(root, 0).toLowerCase(); + a.stake = BigInt(stake); + a.read = true; + }); +} + // Which group an agent is in, for the badge and the filter. function groupOf(a) { const profile = X.simAgent(a.address); @@ -85,27 +103,42 @@ function characterOf(a) { }; } let filter = "all"; +let page = 0; let lastHistory = null; +let tableSeq = 0; // The committed root, linked to the payments it is over as the primary oracle serves them, which // "Check evidence" rebuilds it from. const rootLink = (a) => (X.same(a.root, X.ZERO32) ? X.rootCode(a.root) : `${X.esc(X.short(a.root))}`); -function renderAgents(history = lastHistory) { - lastHistory = history; - const sorted = [...agents].sort((a, b) => b.total - a.total || b.earned - a.earned || a.time - b.time); +// The table, a page at a time in the order the agents registered: an order by score would need +// every agent's score read first. +async function renderAgents() { + const seq = ++tableSeq; + const listed = agents.filter((a) => filter === "all" || groupOf(a).key === filter); + const pages = Math.max(1, Math.ceil(listed.length / PAGE_ROWS)); + page = Math.min(page, pages - 1); + const shown = listed.slice(page * PAGE_ROWS, (page + 1) * PAGE_ROWS); + try { + await readChain(shown); + } catch (e) { + if (seq === tableSeq) setCard("agentsCard", X.failed("the agents' scores from the chain", e)); + return; + } + if (seq !== tableSeq) return; + const history = lastHistory; const count = (key) => agents.filter((a) => groupOf(a).key === key).length; const n = { all: agents.length, outside: count("outside"), sim: count("sim"), own: count("own") }; - const active = agents.filter((a) => a.status === 0).length; - let html = `

${plural(agents.length, "agent")} registered on this deployment, ${active} active.` + // A count of the active agents needs every agent's status, and only the agents shown are read. + const active = agents.every((a) => a.read) ? `, ${agents.filter((a) => a.status === 0).length} active` : ""; + let html = `

${plural(agents.length, "agent")} registered on this deployment${active}.` + (n.sim ? ` ${n.sim} of them are Sigvara's testnet simulation, which runs a simulated economy so the protocol can be watched working.` : "") + ` Both oracle operators are run by the Sigvara team (see Operators), so read these scores as the protocol working, not as outside demand.

`; if (X.simUnknown()) html += '

The list of the testnet simulation\'s agents could not be read, so this page cannot tell its agents from outside ones. Reload to try again.

'; const choices = [["all", "All"], ["outside", "Outside"], ["sim", "Simulated"], ["own", "Sigvara's own"]].filter(([k]) => k === "all" || n[k]); html += `
${choices.map(([k, label]) => ``).join("")}
`; - const shown = sorted.filter((a) => filter === "all" || groupOf(a).key === filter); html += `
`; for (const a of shown) { @@ -123,7 +156,12 @@ function renderAgents(history = lastHistory) { `; } html += "
AgentWhoStatusMatured scoreEarnedStakeEvidence root
"; - html += '

The matured score is the total other contracts read (getTotalScore). It climbs toward the earned score, the one last finalized (getEarnedScore), at a bounded rate a day, and falls at once. How scores work. The agent links open its score epochs, and each evidence root links to the payments it commits to.

'; + if (pages > 1) { + html += `

Rows ${page * PAGE_ROWS + 1} to ${page * PAGE_ROWS + shown.length} of ${listed.length}.` + + ` ` + + `

`; + } + html += `

Agents are listed in the order they registered, ${PAGE_ROWS} to a page. The matured score is the total other contracts read (getTotalScore). It climbs toward the earned score, the one last finalized (getEarnedScore), at a bounded rate a day, and falls at once. How scores work. The agent links open its score epochs, and each evidence root links to the payments it commits to.

`; if (history?.truncated) html += '

The explorer has more registrations than this page reads, so the newest may be missing.

'; html += X.historyNote(history); setCard("agentsCard", html); @@ -131,14 +169,25 @@ function renderAgents(history = lastHistory) { btn.addEventListener("click", () => checkEvidence(btn.getAttribute("data-check"))); } for (const btn of document.querySelectorAll("[data-filter]")) { - btn.addEventListener("click", () => { filter = btn.getAttribute("data-filter"); renderAgents(); }); + btn.addEventListener("click", () => { filter = btn.getAttribute("data-filter"); page = 0; renderAgents(); }); + } + for (const btn of document.querySelectorAll("[data-page]")) { + btn.addEventListener("click", async () => { + btn.disabled = true; + page += Number(btn.getAttribute("data-page")); + await renderAgents(); + // The buttons sit under the rows, so the new page is shown from its top. + $("agentsCard").scrollIntoView({ block: "start" }); + }); } } // ---- the lobby ---- +// The first LOBBY_MAX agents to register. They are the table's first rows, read with them, and a +// wave of new registrations cannot crowd them out of the room. function renderLobby() { $("lobbyCard").classList.remove("u-hidden"); - const people = agents.map((a) => ({ ...characterOf(a), agent: a })); + const people = agents.slice(0, LOBBY_MAX).map((a) => ({ ...characterOf(a), agent: a })); const onPick = (person) => showInLobby(person.agent); // The room with depth (lobby-scene.js) is a module and may not have loaded yet, and needs WebGL. // Until it is here, and wherever it cannot run, the flat room stands in. @@ -225,7 +274,7 @@ async function renderCheck(a, evidence, pendingRead) { } else if (X.same(a.root, X.ZERO32)) { finalHtml = "none yet: no score with an evidence root has been finalized for this agent"; } else { - const m = X.matchRoot(list, a.root, { delays }); + const m = X.matchRoot(list, a.root, { delays, leaves: rebuilt }); if (!m) { finalHtml = `${X.rootCode(a.root)} no reading of these payments reproduces it. The oracle no longer lists the set this score was made on, or lists it differently.`; } else { @@ -239,7 +288,7 @@ async function renderCheck(a, evidence, pendingRead) { if (BigInt(X.word(raw, 8)) === 1n) { const proposedAt = Number(BigInt(X.word(raw, 7))); const root = X.word(raw, 9).toLowerCase(); - const m = bad.length ? null : X.matchRoot(list, root, { at: proposedAt, delays, evidenceCut }); + const m = bad.length ? null : X.matchRoot(list, root, { at: proposedAt, delays, evidenceCut, leaves: rebuilt }); pendingHtml = `${X.rootCode(root)}, proposed ${X.esc(X.fmtWhen(proposedAt))}: ` + (m ? `reproduced from ${describeMatch(m, list.length)}` : 'not reproduced from the payments settled by then'); diff --git a/site/assets/explorer.js b/site/assets/explorer.js index 46ffb413..e4b31265 100644 --- a/site/assets/explorer.js +++ b/site/assets/explorer.js @@ -643,20 +643,21 @@ return keccak(hexBytes(strip(x) + strip(y))); } - // Every layer, leaves first. An odd node is promoted, not duplicated. - function layersOf(leaves) { + // Every layer, leaves first. An odd node is promoted, not duplicated. `pair` hashes two nodes; + // matchRoot passes one that remembers its answers across the trees it builds. + function layersOf(leaves, pair = hashPair) { if (!leaves.length) return []; const layers = [leaves.slice()]; let level = leaves.slice(); while (level.length > 1) { const next = []; - for (let i = 0; i < level.length; i += 2) next.push(i + 1 < level.length ? hashPair(level[i], level[i + 1]) : level[i]); + for (let i = 0; i < level.length; i += 2) next.push(i + 1 < level.length ? pair(level[i], level[i + 1]) : level[i]); layers.push(next); level = next; } return layers; } - const rootOf = (leaves) => (leaves.length ? layersOf(leaves).at(-1)[0] : ZERO32); + const rootOf = (leaves, pair = hashPair) => (leaves.length ? layersOf(leaves, pair).at(-1)[0] : ZERO32); // The sibling path for the leaf at `index`, in the order MerkleProof.verify expects. function proofOf(layers, index) { @@ -683,14 +684,15 @@ * payment enters a score than its settlement: it counts for a cut-off once settledAt plus its * delay has passed. `evidenceCut` ({ quantumSeconds, windowSeconds }, also from /evidence, present * when the oracle reads payment chains) says a proposal's evidence was cut at a whole quantum at - * most the window before `at`, so with `at` those cut-offs are tried too. + * most the window before `at`, so with `at` those cut-offs are tried too. `leaves`, from a + * caller that has built them already, are leafOf of each event in order, and are not hashed again. * * Returns { events, leaves, cut, unset } for the reading that matched, or null. */ - function matchRoot(events, committed, { at = null, maxCuts = 64, delays = {}, evidenceCut = null } = {}) { + function matchRoot(events, committed, { at = null, maxCuts = 64, delays = {}, evidenceCut = null, leaves = null } = {}) { if (!isHash(committed)) return null; const want = committed.toLowerCase(); - const asServed = events.map((e) => leafOf(e)); + const asServed = leaves ?? events.map((e) => leafOf(e)); const signed = events.map((e) => e.outcomeSource === "payer_signed"); const unsetLeaves = events.map((e, i) => (signed[i] ? leafOf(e, null) : asServed[i])); const counts = events.map((e) => Number(e.settledAt) + (e.chainId != null ? Number(delays[e.chainId] ?? 0) : 0)); @@ -703,15 +705,29 @@ const cuts = at !== null ? [Number(at), ...quantized.filter((t) => t < Number(at))] : [Infinity, ...[...new Set(counts)].sort((a, b) => b - a).slice(0, maxCuts)]; + // One memo for every tree tried here. Neighbouring cut-offs keep nearly the same payments in + // the same order, so their trees share every pair left of where they differ, and the keccak in + // did.js is slow enough that hashing each of those pairs again froze the page for seconds. + const memo = new Map(); + const pair = (a, b) => { + const key = a + b; + let h = memo.get(key); + if (h === undefined) memo.set(key, (h = hashPair(a, b))); + return h; + }; // Each cut-off keeps every payment that counted by then, so those times cover every set a // proposal made between two of them could have committed to. + let last = null; for (const cut of cuts) { const idx = events.map((e, i) => (counts[i] <= cut ? i : -1)).filter((i) => i >= 0); + // The same payments as the cut-off before give the same roots, and those did not match. + if (last && idx.length === last.length && idx.every((v, k) => v === last[k])) continue; + last = idx; const tries = [[asServed, false]]; if (idx.some((i) => signed[i])) tries.push([unsetLeaves, true]); - for (const [leaves, unset] of tries) { - const picked = idx.map((i) => leaves[i]); - if (rootOf(picked).toLowerCase() === want) { + for (const [list, unset] of tries) { + const picked = idx.map((i) => list[i]); + if (rootOf(picked, pair).toLowerCase() === want) { return { events: idx.map((i) => events[i]), leaves: picked, cut, unset }; } } diff --git a/site/assets/lobby-scene.js b/site/assets/lobby-scene.js index 740e9a92..afa9aba9 100644 --- a/site/assets/lobby-scene.js +++ b/site/assets/lobby-scene.js @@ -241,6 +241,10 @@ function start(host, people, onPick) { hoopX = step(hoopX, hoopToX, walk * 0.6); hoopZ = step(hoopZ, hoopToZ, walk * 0.6); for (const w of walkers) { + const big = w === hovered || w === picked ? 1.25 : 1; + // Someone seated never moves, so is set again only when the pointer picks them out or lets go. + if (w.how === "sit" && w.big === big) continue; + w.big = big; w.moving = false; if (w.how === "float") { w.x = W * 0.15 * Math.sin(t / 8 + w.slot * 1.9) - W * 0.03; @@ -271,7 +275,6 @@ function start(host, people, onPick) { // A small hop while walking, and a slow breath while standing. const lift = w.how === "sit" || w.how === "float" ? 0 : w.moving ? Math.abs(Math.sin(t * 9 + w.seed)) * 0.07 : Math.sin(t * 2.4 + w.seed) * 0.012; w.mesh.position.set(w.x, w.y + lift, w.z); - const big = w === hovered || w === picked ? 1.25 : 1; w.mesh.scale.set(w.face * big, big, 1); if (w.shadow) w.shadow.position.set(w.x, 0.02, w.z + 0.04); } diff --git a/site/assets/lobby.js b/site/assets/lobby.js index 382ee6a9..2253c99b 100644 --- a/site/assets/lobby.js +++ b/site/assets/lobby.js @@ -148,6 +148,8 @@ el.addEventListener("click", () => { picked = w; onPick(person); place(w); }); group.appendChild(el); w.el = el; + // Someone seated never moves, so is placed once, here, and move() passes them by. + if (w.how === "sit") place(w); return w; }); @@ -176,6 +178,7 @@ hoopX = step(hoopX, hoopToX, walk * 0.6); hoopY = step(hoopY, hoopToY, walk * 0.6); for (const w of walkers) { + if (w.how === "sit") continue; if (w.how === "float") { w.x = W / 2 - SIZE / 2 + W * 0.2 * Math.sin(t / 8000 + w.slot * 1.9); w.y = 16 + 6 * Math.sin(t / 1300 + w.slot); diff --git a/site/epochs.html b/site/epochs.html index e198f1ed..cfc6ba25 100644 --- a/site/epochs.html +++ b/site/epochs.html @@ -114,7 +114,7 @@

Timeline

- + diff --git a/site/integrate.html b/site/integrate.html index ea2ce6eb..caf5c7d9 100644 --- a/site/integrate.html +++ b/site/integrate.html @@ -153,7 +153,7 @@

Going further

- + diff --git a/site/operators.html b/site/operators.html index c1a1ec56..8074ace5 100644 --- a/site/operators.html +++ b/site/operators.html @@ -99,7 +99,7 @@

Bond history

- + diff --git a/site/simulation.html b/site/simulation.html index a9092fa1..9b35c40c 100644 --- a/site/simulation.html +++ b/site/simulation.html @@ -125,7 +125,7 @@

What to look for

- + diff --git a/site/status.html b/site/status.html index 86640989..dd831b83 100644 --- a/site/status.html +++ b/site/status.html @@ -77,7 +77,7 @@

The scores

- +