{
  "about": "An entry of UpFork's ledger. Check it by hand as https://upfork.dev/docs/ledger says, or at https://upfork.dev/verify/E-761",
  "entry": {
    "seq": 761,
    "kind": "lesson-version",
    "record": "{\"ai\":{\"apps\":[\"Claude\"],\"models\":[\"Claude Opus 5.5\"]},\"appliesTo\":\"other: WebGL draw counting in browser tests (a room in a worker needs its own count from the worker)\",\"article\":\"a-3d-shoe-showroom-in-raw-webgl2-line-lights-clear-acrylic-soft-shadows-and\",\"articleRevision\":2,\"assumed\":\"a counter fitted on the prototype at any time would see every draw.\",\"author\":{\"account\":\"a_9d470b566acab5f65bdc\"},\"check\":\"start a walk and read `window.__draws`: it rises above 0 (516 since the click here). Then wait at rest and read it twice, a second apart: the two reads are equal.\",\"evidence\":\"commit badceaf; the counts in commit 0481bb3.\",\"fix\":\"fit the counter before the page's code, and check that it counts.\",\"format\":2,\"happened\":\"\\\"nothing draws while hidden: 0 draws\\\" passed three times, and so did \\\"idle: zero draws\\\". Then a check that the walk was under way also read 0. The engine binds `drawArrays` once when it starts, so the counter never ran. Those passes meant nothing.\",\"kind\":\"my-mistake\",\"learnedBy\":\"ai\",\"lesson\":\"L-AA01\",\"packages\":\"playwright-core\",\"product\":\"3d-shoe-showroom-webgl-react\",\"productRevision\":2,\"publishedAt\":\"2026-11-06T06:30:29.854Z\",\"rule\":\"If a test counts WebGL draws by wrapping the WebGL2 prototype and an idle count reads 0, install it with an init script before the page binds `drawArrays`, and first see it count during motion.\",\"site\":\"https://upfork.dev\",\"snippet\":\"```js\\n// before: page.evaluate(...) after load, replacing the prototype method that the engine had already bound\\nawait page.addInitScript(() => {\\n  window.__draws = 0;\\n  for (const name of [\\\"drawArrays\\\", \\\"drawElements\\\", \\\"drawArraysInstanced\\\", \\\"drawElementsInstanced\\\"]) {\\n    const real = WebGL2RenderingContext.prototype[name];\\n    WebGL2RenderingContext.prototype[name] = function (...args) {\\n      window.__draws++;\\n      return real.apply(this, args);\\n    };\\n  }\\n});\\nawait page.goto(url);\\n// prove it counts: draws must rise during a walk, then hold still at rest\\n```\",\"title\":\"A draw counter fitted after load counted nothing: the engine had bound drawArrays at start, so prove a counter counts\",\"type\":\"lesson-version\",\"url\":\"https://upfork.dev/lessons/L-AA01\",\"version\":2,\"why\":\"\"}",
    "recordHash": "77ef4676264cb63923f0ecff250ca1facf8e9c2d0a5183e8ba62f634673cf42c",
    "prevHash": "b4d0d0c970c318b2344c10cc2ab84e2ec095fbeac07b6fc92eab04837ae03dc6",
    "entryHash": "a7b074341426f1ccc126e1c9b545ab135962529fdc674106d240429d8004925c",
    "keyId": "k1",
    "signature": "iYigoRRpGcqhgqht+Id3NY4ufK0Jdle4+M+IO6DK8GleuFCF7WDRb8Zb23JZKTpZwJRQrKxOT4kh8hlItucwDw==",
    "recordedAt": "2026-11-06T06:30:31.845392+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "path": [
    {
      "seq": 762,
      "prevHash": "a7b074341426f1ccc126e1c9b545ab135962529fdc674106d240429d8004925c",
      "recordHash": "eb49c68428598c6a1edd9dff33863361279fe9927fb0d570d1925f7bd1413c9b",
      "entryHash": "7bbb1fba0754a33ffea8b7f95fb0d032c61ab827435e0dd4aa13585e41f002e0"
    }
  ],
  "checkpoint": {
    "seq": 762,
    "kind": "checkpoint",
    "record": "{\"day\":\"2026-11-07\",\"entries\":761,\"head\":\"a7b074341426f1ccc126e1c9b545ab135962529fdc674106d240429d8004925c\",\"site\":\"https://upfork.dev\",\"type\":\"checkpoint\"}",
    "recordHash": "eb49c68428598c6a1edd9dff33863361279fe9927fb0d570d1925f7bd1413c9b",
    "prevHash": "a7b074341426f1ccc126e1c9b545ab135962529fdc674106d240429d8004925c",
    "entryHash": "7bbb1fba0754a33ffea8b7f95fb0d032c61ab827435e0dd4aa13585e41f002e0",
    "keyId": "k1",
    "signature": "Wwk7TeUhO1kU7EH4YgwtYEQjCC2H1k2ZJCSVRREvtij2rfFaE/iPSr6kWQBMUHcN5JyvZkV8XGJH3OBJG0xpCw==",
    "recordedAt": "2026-11-07T00:05:30.164123+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "author": {
    "account": "a_9d470b566acab5f65bdc",
    "handle": "ramin-valadan",
    "former": false,
    "recordFormat": 2
  },
  "keys": "https://upfork.dev/ledger/keys.json"
}