diff --git a/.github/workflows/silicon.yml b/.github/workflows/silicon.yml index 48d4743..af1cd19 100644 --- a/.github/workflows/silicon.yml +++ b/.github/workflows/silicon.yml @@ -11,6 +11,29 @@ jobs: persist-credentials: false - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 with: - node-version: '22' + node-version: "22" - run: node tests/hardware-catalog.mjs - run: cargo test -p doke-core --locked + browser-and-wasm: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + with: + persist-credentials: false + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + with: + node-version: "22" + - run: rustup target add wasm32-unknown-unknown + - run: cargo install wasm-bindgen-cli --version 0.2.100 --locked + - run: cargo build -p doke-web --target wasm32-unknown-unknown --release --locked + - run: wasm-bindgen target/wasm32-unknown-unknown/release/doke_web.wasm --target web --out-dir public/pkg --out-name doke + - run: npm ci + - run: npx playwright install --with-deps chromium + - run: node tests/silicon-wasm.mjs + - name: Exercise rendered dataflow and controls + run: | + python3 -m http.server 4181 --bind 127.0.0.1 --directory public > /tmp/doke-preview.log 2>&1 & + DOKE_SERVER_PID=$! + trap 'kill "$DOKE_SERVER_PID"' EXIT + node tests/silicon-browser.mjs diff --git a/README.md b/README.md index fa8591a..2a74a05 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # doke -A floating, interactive brain explorer built with Rust, WebAssembly and wgpu. Explore reference anatomy, an enlarged neural tissue window, chemical synapses, a neural circuit and molecular messengers. Mostly grayscale, with restrained color accents and adaptive HDR. +A floating explorer of brains and silicon, built with Rust, WebAssembly and wgpu. Paint an input and follow it through CPU, GPU and tensor models, or inject packets into a switch ASIC model. Explore the human brain through reference anatomy, neural tissue, synapses, circuits and molecular messengers. Mostly grayscale, with restrained color accents and adaptive HDR. ![A short tour of doke: brain anatomy, activity playback, enlarged neurons, synaptic signaling, neural circuits, molecular messengers and scientific source tabs.](docs/media/doke-demo.gif) @@ -19,6 +19,14 @@ Open [localhost:4173](http://localhost:4173). Rendering and simulation run in th The [doke guide](docs/GUIDE.md) covers controls, scientific interpretation, builds, verification and hosting. It is the single maintained project guide. +## Inside silicon + +Open **Silicon** in the top navigation. Paint an 8 × 8 image, step the computation, change memory layout, or block a switch destination. The schematic responds to the actual Rust model. Curated AMD, NVIDIA, Google TPU and Cisco references provide source-linked product facts. The teaching model is separate from those specifications: its ticks do not predict a commercial chip’s speed. + +![The GPU teaching model running a painted input through memory and arithmetic lanes.](docs/media/silicon.webp) + +The [silicon research and roadmap](docs/SILICON.md) explains the evidence, modeling boundaries and planned iterations. + ## What is calculated Brain geometry derives from the Allen Human Reference Atlas; molecule coordinates come from PubChem. Activity highlights, enlarged neurons, synaptic contacts and traveling particles illustrate supported concepts. They are not reconstructed individual cells or measured firing/chemical concentrations. The simplified neural circuit integrates population dynamics in Rust. Source records and scientific limitations are available in the interface. @@ -27,7 +35,7 @@ Brain geometry derives from the Allen Human Reference Atlas; molecule coordinate | Directory | Purpose | | ------------------ | ---------------------------------------------------- | -| `crates/doke-core` | Activity envelopes and numerical E/I model | +| `crates/doke-core` | Brain activity, E/I dynamics and silicon models | | `crates/doke-web` | Rust rendering, camera, procedural cells, shaders | | `public` | Floating interface, source records, runtime assets | | `tools` | Asset generation, validation, builds and deployment | diff --git a/crates/doke-web/src/lib.rs b/crates/doke-web/src/lib.rs index 5efbf6c..ffd6ad3 100644 --- a/crates/doke-web/src/lib.rs +++ b/crates/doke-web/src/lib.rs @@ -196,8 +196,13 @@ impl BrainRenderer { &wgpu::DeviceDescriptor { label: Some("Brain renderer"), required_features: wgpu::Features::empty(), - required_limits: wgpu::Limits::downlevel_webgl2_defaults() - .using_resolution(adapter.limits()), + // The scene writes color and glow; asking for the default eight + // attachments rejects valid WebGL adapters that expose fewer. + required_limits: wgpu::Limits { + max_color_attachments: 2, + ..wgpu::Limits::downlevel_webgl2_defaults() + .using_resolution(adapter.limits()) + }, memory_hints: wgpu::MemoryHints::MemoryUsage, }, None, diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 7428ba4..dc3772e 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -15,6 +15,16 @@ The top navigation chooses **Brain**, **Synapse**, **Neural circuit** or **Messe All explanations use the floating panel on the **left**. About, source records, anatomy regions, activity stories, messenger explanations and model evidence open as named tabs. Reopening an item reuses its tab. Select an earlier tab to return; its reading position is preserved. The × button closes the current tab and returns to the document that opened it; the downward chevron hides the panel without discarding its tabs. Arrow keys, Home and End navigate the tab strip, which scrolls horizontally when needed. Only one document is visible, and tools automatically dismiss the reader on narrow screens. Scene changes hide the reader; its open tabs remain available. Animation updates do not replace a source being read. +## Silicon + +Choose **Silicon ↗** in the brain navigation, or open `silicon.html`. CPU, GPU and Tensor process the same painted 8 × 8 image using a fixed difference filter. Run animates execution; Step advances one declared model tick; ⇥ calculates the completed result. Drag or use arrow keys to orbit; scroll or +/− zoom. Select a block to inspect its current state. Source records stay in the same floating tab panel. + +Change Packed to Strided on GPU to see memory-sector traffic change while the answer stays the same. Toggle the CPU’s tiny cache to expose operand reuse. Tensor shows operands passing through a 4 × 4 array. In Switch ASIC, block A, inject traffic to A and B, then compare FIFO with per-destination VOQ. Queue changes preserve packets; the 32-packet capacity includes in-flight transfers. Reset clears the experiment. + +Reference selections show documented product facts. The small models demonstrate mechanisms, not proprietary layouts or timing. Model ticks, bytes and packet counts describe the explicit teaching rules. They are not benchmarks, die floorplans, a CPU instruction emulator or an execution trace captured on the named product. The [research and roadmap](SILICON.md) records the primary sources and next steps. + +The standalone silicon page does not need generated anatomy. For a quick hardware-only preview, build Wasm with `cargo build -p doke-web --target wasm32-unknown-unknown --release --locked`, run the matching `wasm-bindgen` command from `tools/build.sh`, then serve `public/`. Use the complete setup below for the human brain and all original scenes. + ## Neurons and scientific interpretation The optional tissue window contains four procedural branching neurons, dendritic spines, axonal terminals, receiving processes and visible contact gaps. It occupies a localized area of the reference brain and is off initially. The cells are deliberately enlarged; **their positions, numbers, shapes and connectivity do not come from the atlas**. Flashing particles illustrate signaling and are not computed action potentials. This presentation draws on the structural distinctions discussed in [Spruston's review of pyramidal neurons](https://pubmed.ncbi.nlm.nih.gov/18270515/). @@ -60,6 +70,9 @@ With the local server running: ```sh cargo test -p doke-core --locked +node tests/hardware-catalog.mjs +node tests/silicon-wasm.mjs +DOKE_URL=http://127.0.0.1:4173 node tests/silicon-browser.mjs .venv/bin/python tools/validate_assets.py npm test node tests/refinement.mjs diff --git a/docs/media/silicon.webp b/docs/media/silicon.webp new file mode 100644 index 0000000..a6c0393 Binary files /dev/null and b/docs/media/silicon.webp differ diff --git a/package.json b/package.json index 33a74b4..3c0a8a2 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "build": "bash tools/build.sh", "test:deployed": "node tests/deployed.mjs", "test:performance": "node tests/performance.mjs", - "format": "prettier --write public/app.js public/style.css public/index.html tests/*.mjs" + "format": "prettier --write public/app.js public/style.css public/index.html tests/*.mjs", + "test:silicon": "node tests/hardware-catalog.mjs && node tests/silicon-wasm.mjs && node tests/silicon-browser.mjs" }, "devDependencies": { "playwright": "1.58.2", diff --git a/public/index.html b/public/index.html index 6701dc7..440fdcf 100644 --- a/public/index.html +++ b/public/index.html @@ -23,7 +23,8 @@ ··· + >·Silicon ↗