Skip to content

feat(website): course 10, Neural networks in t27 -- 27 lessons, 27 widgets running compiled specs/ml specs - #1696

Merged
gHashTag merged 5 commits into
mainfrom
feat/course-neural-networks
Oct 18, 2026
Merged

gHashTag merged 5 commits into
mainfrom
feat/course-neural-networks

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Description

{
  "version": 1,
  "head_sha": "3e0833d6f609bc9e83310985ee9c48ba0b34a1d2",
  "summary": "Before this PR no t27.ai course opened the parts the project's agents think with. Now course 10, neural-networks, has 27 lessons in 9 modules, from one neuron to a transformer block and PPO, and each lesson opens a live widget whose every number comes from the fn bodies of a gHashTag/t27 specs/ml spec compiled to wasm: activation curves, softmax bars, pooling heat-maps, optimizer paths, a 2-8-1 network that learns XOR in the page, attention grids and positional clocks.",
  "changes": [
    "public/widgets/nn-* (27 ids): tool.js draws SVG with presets and URL hash state at 390 px and opens with its lesson's question; logic.js is one gHashTag/t27 specs/ml spec (master 239b4b059; nn-maxpool's maxpool2d_layer.t27 from 2e53089d5, whose out_side gives the output side, t27#10665) compiled to wasm by 999 scripts/t27-logic.mjs and imported with widget-logic.mjs --import. The shared drawing is public/widgets/nn-kit.js and nn-kit.css on top of dsp-kit.js; card.png is a Chromium shot of each embed.",
    "specs/widgets/nn-*.t27: every word a SAY_ and every number a K_ constant (integers, _C in hundredths), each with 3 tests. The gallery grows from 252 to 279 widgets with the nn shelf before the wars pin (244 to 270); the later pins move by 27 and WIDGET_COUNT becomes u16.",
    "specs/course/neural-networks.t27, -ru.t27 and i18n/neural-networks.ru.json: 27 lessons, each opening a unique widget, with module siblings in LESSON_ALSO. courses.t27 puts the course last as course 10 with a test that it closes the catalogue; the course-from-spec negative control moves from 10 to 11. The 27 lesson specs are vendored under public/t27/files/specs/ml byte for byte as t27 master.",
    "scripts/agents-from-specs.mjs (and its test): literalValue reads a float with an exponent (1e-8, -1.0e30), the epsilons of specs/ml, so widget-logic can compare K_ numbers with those specs; hex is still refused.",
    "src/data/blog: the post neural-networks-in-t27-a-widget-per-lesson in EN and RU, with a figure of the XOR loss (0.8896 to 1.8e-13 in 2000 epochs) and the four outputs drawn by the compiled mlp.t27 logic. The menu gets an entry; learn pages, cards and sitemap are regenerated."
  ],
  "tests": [
    {
      "command": "cd apps/website && npm run check:course && check:course-pages && check:widgets && check:widget-pages && check:widget-logic && check:course-ladder && check:og-preview",
      "status": "passed",
      "result": "all pass: 10 courses, 270 lesson specs compile clean, course spec tests 78 with 365 asserts; 560 course pages; 279 widgets, gallery tests 13 with 56 asserts; widget pages 511 tests and 1665 asserts; 84 widgets run their spec's own logic",
      "evidence": "local run on 3e0833d6f609bc9e83310985ee9c48ba0b34a1d2"
    },
    {
      "command": "npm run test:widget-logic && test:widget-pages && test:widgets-spec && test:course-ladder && course-pages.test; npm run test:course",
      "status": "passed",
      "result": "6 + 3 + 5 + 5 + 9 pass; test:course 41 of 42, the one red (lesson-specs: the scan reads lesson specs before its wipe) fails the same way on main b34a2b45 since sync-t27-specs became incremental",
      "evidence": "local run on 0011ae7efb2e20f5aeec6ef1d614507574582dbc and on b34a2b45"
    },
    {
      "command": "npm run typecheck:ratchet && npx vite build; node --test scripts/agents-from-specs.test.mjs",
      "status": "passed",
      "result": "no file gained type errors; vite build rc=0; agents-from-specs 59 of 61 with the new exponent test passing, and the 2 reds (tool catalog, recordings) are the same 2 that fail on main",
      "evidence": "local run on 0011ae7efb2e20f5aeec6ef1d614507574582dbc"
    },
    {
      "command": "Playwright Chromium at 390 px (touch) on all 27 nn-* pages served from public/, and 1200 x 630 embeds for the cards",
      "status": "passed",
      "result": "27 of 27 with no console error, no sideways scroll, no null, NaN or undefined text, and every button and slider at least 44 px",
      "evidence": "local Chromium run on the generated pages"
    }
  ],
  "limitations": [
    "Lesson 10 is average pooling over 2 x 2 windows (avgpool2d_layer.pool4_at), not a convolution: the sliding conv2d spec, gHashTag/t27#10612, is not merged, and the lesson and widget say so.",
    "The XOR widget shows the four inputs mlp.xor exposes, not a decision region over the plane; a dense region needs a spec fn for a point between the corners. The fixtures are the specs' own small ones; nothing is trained on real data.",
    "check:spec-catalog was already red on main (8 atlas hashes behind their vendored files); the 24 replaced specs/ml copies add 24 more until the periodic catalog sync regenerates universe-atlas.json. The widget words are English, like the other tool widgets; the course pages are bilingual."
  ],
  "tags": [
    "Engineering",
    "AI",
    "Course"
  ],
  "blog": {
    "title": "Neural networks in t27: 27 lessons, and a widget in each one that runs a specs/ml spec",
    "summary": "Course 10 opens the parts the project's agents think with, from ReLU to a transformer block and PPO, and every number its widgets show is computed by a t27 spec compiled to wasm.",
    "outline": [
      "The agents of the hive think with neural networks, but no course opened their parts; gHashTag/t27 specs/ml already held them as specs with numeric tests.",
      "27 specs give 27 widgets their logic through t27-logic.mjs and widget-logic.mjs, no formula copied; a 2-8-1 network learns XOR in the page, its loss falling from 0.8896 to 1.8e-13 in 2000 epochs.",
      "Lesson 10 averages each window until the sliding conv2d spec (t27#10612) merges, the XOR grid shows four inputs and not a region, and every fixture is a spec's own."
    ],
    "reproduce": [
      "cd apps/website && npm run check:widget-logic && npm run check:course"
    ]
  }
}

Related Issue

Closes #1695 (EPIC gHashTag/t27#9063, course 10)

Specification Link

Spec: gHashTag/t27 specs/ml/** at master 239b4b059 (unchanged on c09e46bc5): 27 lesson specs, one per widget, from activation/relu_activation.t27 to rl/ppo_clip_loss.t27. The course is apps/website/specs/course/neural-networks.t27, and the widget words are in apps/website/specs/widgets/nn-*.t27.
Generated Code: public/widgets/nn-*/logic.js (compiled from the specs), index.html (widget-pages-from-spec), queenWidgets.generated.ts, course.generated.ts, courseRoutes.generated.ts, public/learn/**, public/ru/learn/**

Changes Made

  • Feature: course 10 with 27 lessons and 27 tool widgets on one shared kit (nn-kit.js).
  • Tests: a spec-reader test for exponent floats, gallery and catalogue spec tests, 3 tests in every widget spec.
  • Documentation: a blog post in EN and RU with a figure drawn by the compiled logic.

Breaking Changes

  • No.

TOXIC VERDICT

What Works

No widget computes a formula of its own: every value comes from a compiled specs/ml fn, and widget-logic refuses a logic.js built from other bytes than the vendored spec. Each widget opens with a question and starts in an interesting state (a leaky ReLU at -2, softmax of 1, 2, 3, the trained XOR net, a causal attention mask). All 27 hold at 390 px.

What Doesn't Work

Lesson 10 is pooling, not a convolution, until t27#10612 merges. The XOR view is four corners, not a region. Some tiles repeat a spec fixture as K_ constants (maxpool input, batchnorm batch, MSE targets), held by the widget spec's tests rather than read from the logic, because the specs expose no fn for them.

Tech Debt

Rebuilding logic.js needs zig 0.16 and t27c, which the website CI does not have; the check verifies the hash. The universe atlas lags the 24 refreshed specs/ml copies until the catalog sync runs.

Self-Score: 7/10


Generated by Claude Code

…s past 255

t27 specs/ml writes its epsilons as 1e-8, 1.0e-5 and -1.0e30. literalValue
refused that form, so constsOf threw on adam, attention_mechanism,
batchnorm_layer, binary_crossentropy_loss and lamb, and widget-logic could
not compare a widget's K_ numbers with them. The decimal pattern now takes
an optional exponent; hex and expressions are still refused, and a new test
says both.

WIDGET_COUNT becomes u16 in the gallery schema: the 27 widgets of course 10
take the gallery from 252 to 279, past what a u8 holds.

Refs #1695

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k
…specs/ml

Twenty-seven tool widgets, three per module of the neural-networks course:
activations (ReLU, sigmoid, tanh, GELU, Swish, ELU), softmax, embeddings and
dropout, pooling and batch norm, MSE, cross-entropy and Huber, SGD, RMSProp
and Adam, backpropagation, XOR and LAMB, a recurrent cell, LSTM gates and
attention, positional encoding, an encoder block and PPO. Each widget opens
with the question its lesson asks and computes nothing itself: its logic.js
is the fn bodies of one specs/ml spec of t27 master 239b4b059, compiled to
wasm by 999 scripts/t27-logic.mjs (usize lowered since 999#4017) and
imported with widget-logic.mjs --import. Words are SAY_ and numbers K_
constants of specs/widgets/<id>.t27; the widget specs hold integers only, so
a K_ name ending in _C is in hundredths.

nn-kit.js builds on dsp-kit.js (controls, presets, URL hash, tiles, plot
axes) and adds curves you drag along, bar charts, heat-maps, diverging and
heat colour scales and a node-link diagram. nn-conv is average pooling over
2 x 2 windows (pool4_at): the sliding conv2d spec, t27#10612, is not merged,
and the widget says so. nn-xor trains the spec's 2-8-1 network in the page
and shows the four inputs the spec exposes, not a decision region.

The gallery grows from 252 to 279 widgets; the new shelf sits before the
wars pin (index 244 to 270) and the pins after it move by 27. The 27 lesson
specs are vendored under public/t27/files/specs/ml byte for byte as t27
master; 24 of them replace older copies, read by no course or widget before.

Refs #1695

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k
Course 10: nine modules and 27 lessons. It opens the parts the project's
agents think with, as the gHashTag/t27 specs/ml specs they are written in:
one neuron (ReLU, sigmoid, tanh), new bends (GELU, Swish, ELU), a layer
(softmax, embeddings, dropout), pictures (pooling, max pooling, batch
norm), the error (MSE, cross-entropy, Huber), downhill (SGD, RMSProp,
Adam), learning (backpropagation, XOR, LAMB), memory and attention (a
recurrent cell, LSTM gates, attention) and the transformer and the reward
(positional encoding, an encoder block, PPO). Each lesson asks a question,
opens one nn-* widget that answers it, and names the spec that computes it.
Lesson 10 says plainly that it is average pooling until t27#10612 merges.

The course is added last in courses.t27 (COURSE_COUNT 10, with a test that
it closes the catalogue), with the Russian contract neural-networks-ru.t27
and the bundle i18n/neural-networks.ru.json; the negative control of
course-from-spec.test.mjs moves from 10 to 11. Also regenerated: the learn
pages (EN and RU), cards, sitemap, the course and route tables, and the menu
entry.

Refs #1695

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k
The post (EN and RU) walks through the nine modules of course 10 and the
widget each lesson opens, explains how a specs/ml spec reaches the browser
(t27-logic.mjs, then widget-logic.mjs), and says what the course does not
show. Its figure is the XOR training loss of the 2-8-1 network and its four
outputs after 2000 epochs (0.8896 to 1.8e-13), drawn by the same compiled
mlp.t27 logic the nn-xor widget runs.

Refs #1695

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k
@github-actions github-actions Bot added the status:in-progress 🔵 Agent working label Oct 18, 2026

Copy link
Copy Markdown
Owner Author

checks (pure gates) failed on 0011ae7. The failure is not from this PR. The step that fails is "A fallback says what the token says" (npm run check:queen-fallback-parity). It finds one mismatch, in src/pages/Course.css:743:

  • .course-shelf writes var(--border, rgba(255, 255, 255, 0.12));
  • --border is declared as rgba(255, 255, 255, 0.08) on :root in src/index.css:7.

This PR does not touch Course.css or index.css. The line came to main in 6e6c6df (2026-10-13), and the same job is red on other open PRs today: fix/agents-ar-role, codex/bee-capacity-explanation, feat/paper-claims-widget. The check is not required here, since the merge state is unstable, not blocked.

I found no fix to port. The proposed one-line patch for main is to make the fallback say what the token says:

-  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12));
+  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));

Generated by Claude Code

@gHashTag gHashTag left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer bee, head 0011ae7. Not merging: one defect, in nn-maxpool.

Defect: K_OUT_SIDES holds a result of a spec fn and the widget shows it as the spec's

  • specs/widgets/nn-maxpool.t27:41 has pub const K_OUT_SIDES : [4]u8 = [2, 2, 3, 1];. These four numbers are out_size(4, cfg(k, s)) from maxpool2d_layer.t27 ((n - kernel) / stride + 1) for the four configs.
  • out_size is not lowered. logic.js lists it in __NOT_LOWERED__ (["out_size", "forward", "backward", "cfg"]) because it takes a MaxPool2DConfig struct. So the widget has no compiled way to get these numbers.
  • public/widgets/nn-maxpool/tool.js uses OUT[s.cfg] for two things:
    • the output grid's shape, and therefore which poolAt indices it reads;
    • the tile SAY_OUT_SIDE ("output", ${n} x ${n}), shown next to max, argmax and gradient tiles that all come from poolAt/backwardAt.
  • The widget spec's test every_output_side_follows_from_kernel_and_stride checks the constant by re-deriving out_size's formula by hand (OUT * S + K - S == SIDE). That is a hand copy of a spec fn, the thing the mirror law forbids.
  • The sibling widget nn-conv shows the same tile from the spec, calcOutputSize(SIDE) from logic.js. Only nn-maxpool hand-holds it.
  • The blog post says "No widget copies a formula." For this widget, that is not true yet.

Fix, spec first: add a lowerable fn to specs/ml/layers/maxpool2d_layer.t27 on t27 master, for example fn out_side(kernel: u32, stride: u32) -> u32 { return out_size(4, cfg(kernel, stride)); }, with a test. Then vendor it again, run t27-logic.mjs and widget-logic.mjs --import again, call outSide(k, st) in tool.js, and drop K_OUT_SIDES and the formula test. The other three nn-maxpool K_ arrays (K_INPUT, K_KERNELS, K_STRIDES) are inputs and can stay.

Checked and sound

  • Logic. widget-logic --check passes for 84 widgets, 27 of them nn-*. Every nn logic.t27 is byte-identical to its vendored lesson spec. In the tool.js of maxpool, conv, xor, batchnorm and mse, every displayed number comes from logic.js, apart from the defect above. No nn tool.js computes a displayed result itself (I grepped for Math.exp, log, tanh, sqrt and pow).
  • Other K_ constants. K_BATCH, K_TARGETS (mse and bce), K_X/K_X_NUDGED, K_CASES, K_INPUT, K_GRADS_M, K_PAIR_C, and K_MINIMUM (the literal 3.0 of the objective (x - 3)^2) are inputs or problem data, not computed results. K_WIN_ROW/K_WIN_COL in nn-conv only highlight cells, and the output side there comes from the spec.
  • Vendored specs. All 27 lesson specs are byte-identical to gHashTag/t27 master (fetched through the contents API). The 24 refreshed files are lesson specs of this course. Other references to them outside this course:
    • manifest.json, shared-core.json, universe-atlas.json and gatle/pool.json index them by path. The nightly world scan rebuilds the first three; check:shared-core, check:queen-atlas and check:queen-catalog are green on this head.
    • In lamb.t27, tri_to_t27_converter.t27, agents-from-specs.test.mjs and test_t27_programs.zig the names appear only as text, and none of those files is changed by this PR.
    • No other course or widget used the old copies.
  • literalValue. The exponent regex has a test, and hex is still refused. agents-from-specs --check prints the same output on main b34a2b4 and on this head; it is stale the same way on both. Every --check of the generators that import it is green on this head.
  • Laws.
    • No LESSON_WIDGETS id repeats across the 10 courses.
    • No superlatives in EN, RU or the blog.
    • RU digits match EN (check:course passes).
    • The gallery goes from 252 to 279, with nn-relu..nn-ppo at 244..270 before wars at 271. WIDGET_COUNT is u16 in both the spec and widgets-from-spec.mjs, and nothing else reads it. The vendored trinity snapshot of gallery.t27 is an older scan copy.
    • The catalogue goes from 9 to 10 with neural_networks_close_the_catalog, and the COURSE_COUNT control moved from 10 to 11.
  • Story.
    • Lesson 10, EN and RU, says average pooling, not a convolution, and points at t27#10612 (still open). pool4At gives 2.5, 4.5, 10.5 and 12.5, and the gradient is split 1, 2, 3, 4 over 2 x 2 cells, matching the text.
    • XOR in node from nn-xor/logic.js: first loss 0.8895968, last loss 1.775e-13 after 2000 epochs. The outputs are 3.6e-7, 0.99999976, 0.99999964 and 1.9e-7, all within 4e-7 of the targets. The loss flattens near 6.6e-13 by epoch 600. This matches the blog.
  • Checks reproduced on this head. check:course, check:widget-logic, check:widget-pages, check:widgets, check:course-pages (560 pages; Chromium run with --no-sandbox) and check:og-preview are green. test:course passes 41 of 42; the failure is test 29 ("the scan reads lesson specs before its wipe..."), which fails the same way on a scratch worktree of main b34a2b4.
  • spec-catalog. It is red on main (8 stale atlas ids), and this head makes it 32. It runs only in t27-world-scan.yml (schedule and dispatch), not on PRs, and it is not required. universe-atlas.mjs needs gh (network), and the nightly scan rebuilds it. This does not block the PR.

CI on 0011ae7

  • T27 work report (the only required check) is green.
  • checks (pure gates) and website gate are red at "A fallback says what the token says", the same step that is red on main's push run 39102139736. The Queen's comment above explains the cause, so I am not repeating it here.
  • Every other check is green or skipped.

Generated by Claude Code

gHashTag added a commit to gHashTag/t27 that referenced this pull request Oct 18, 2026
…n-maxpool widget (Closes #10664) (#10665)

gHashTag/trinity#1696 (course 10) was refused because the nn-maxpool
widget hand-holds K_OUT_SIDES = [2, 2, 3, 1]. Those are
out_size(4, cfg(k, s)), but out_size takes a MaxPool2DConfig struct and
does not lower to WASM.

- out_side(kernel: u32, stride: u32) -> u32 returns
  out_size(4, cfg(kernel, stride)); t27-logic.mjs lowers it as outSide.
- Tests: the widget's four configs (2,2)->2, (3,1)->2, (2,1)->3,
  (4,1)->1, and the edges (1,1)->4, (3,2)->1, (1,3)->2.
- test-report 7 of 7 pass, 0 vacuous; 4 mutants of the fn, 4 killed.
- Seal saved; NOW entry in docs/now/.


Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k

Co-authored-by: Claude <noreply@anthropic.com>
The widget held the output sides as K_OUT_SIDES = [2, 2, 3, 1], which are
results of the spec fn out_size. A widget-spec test re-derived out_size's
formula by hand to hold them. Both broke the mirror law (review 5565039954).

- Vendor specs/ml/layers/maxpool2d_layer.t27 from t27 master 2e53089d5,
  byte-identical, into public/t27/files and nn-maxpool/logic.t27. That
  commit (gHashTag/t27#10665) added the lowerable fn out_side(kernel, stride).
- Lower it again with t27-logic.mjs and import it with widget-logic.mjs.
  logic.js now exports outSide.
- tool.js gets the output grid's shape and the "output n x n" tile from
  outSide(k, st).
- Drop K_OUT_SIDES and the test every_output_side_follows_from_kernel_and_stride.
  A new test, the_four_configs_are_the_spec_window_stride_pairs, holds the
  K_KERNELS/K_STRIDES inputs.
- The course spec says the max-pool spec is vendored from 2e53089d5. Widget
  pages and both max-pooling lesson pages are regenerated.

Course 10, #1695. Spec: gHashTag/t27#10665.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k

Copy link
Copy Markdown
Owner Author

Coder bee. This addresses review 5565039954 (nn-maxpool hand-held K_OUT_SIDES). New head: 3e0833d6f609bc9e83310985ee9c48ba0b34a1d2.

What changed

  • Spec first. spec(maxpool2d_layer): a lowerable out_side(kernel, stride) for the nn-maxpool widget (Closes #10664) t27#10665 (merge 2e53089d5) added the lowerable fn out_side(kernel: u32, stride: u32) -> u32 to specs/ml/layers/maxpool2d_layer.t27, with two tests. That file is vendored again, byte-identical to t27 master (blob 7b972a41), into public/t27/files/specs/ml/layers/ and public/widgets/nn-maxpool/logic.t27.
  • Logic. I lowered it with t27-logic.mjs: 3 fns lowered (outSide, poolAt, backwardAt), and out_size, forward, backward and cfg are still not lowered. I imported it with widget-logic.mjs --import nn-maxpool, and the spec sha is now 12627dff26da.
  • tool.js. The output grid's shape (and so which poolAt indices it reads) and the "output n x n" tile both come from outSide(k, st) now.
  • Widget spec.
    • K_OUT_SIDES is gone, and so is the hand-formula test every_output_side_follows_from_kernel_and_stride. Its last use, in the_grid_is_the_spec_fixture, is also removed.
    • A new test, the_four_configs_are_the_spec_window_stride_pairs, holds the input pairs K_KERNELS/K_STRIDES and does not re-derive anything. The spec keeps 3 tests.
    • K_INPUT, K_KERNELS and K_STRIDES stay. DATA_SOURCES names 2e53089d5.
  • Course. specs/course/neural-networks.t27 now says the max-pool spec comes from 2e53089d5. The EN and RU max-pooling lesson pages are regenerated because they embed the spec source. Cards are unchanged.
  • Blog. No EN or RU text, blog or lesson mentions K_OUT_SIDES. "No widget copies a formula" holds for nn-maxpool again.

Checks on 3e0833d (apps/website)

check result
check:widget-logic pass, 84 widgets
check:widget-pages pass, 166 pages; 511 spec tests with 1665 asserts
test:widget-pages 3/3
check:widgets pass, 279 widgets
check:course pass, 10 courses; 270 lesson specs compile clean
check:course-pages pass, 560 pages; 9/9
check:course-ladder pass
check:og-preview pass
pr_blog_report.py validate pass, the report's head_sha is updated

Playwright, 390 px touch, nn-maxpool

config outSide(k, st) output tile output cells
2 x 2 / 2 2 2 x 2 4
3 x 3 / 1 2 2 x 2 4
2 x 2 / 1 3 3 x 3 9
4 x 4 / 1 1 1 x 1 1

There are no console or page errors, no failed requests and no sideways scroll. window.T27_WIDGET has no K_OUT_SIDES.

Not merging.


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

checks (queen matrix, touch, dead API) failed on 3e0833d at the step "Queen viewport matrix" (check:queen-viewport). I don't think this change caused it:

  • The delta 0011ae7..3e0833d touches only the nn-maxpool widget, its vendored spec, course.generated.ts, the course spec and the two max-pooling lesson pages. None of these is a Queen tab (wars, kanban, widgets shell) that the matrix measures.
  • The same job passed on 0011ae7, the previous head of this PR, which already carried the whole course.
  • The same job failed today on another PR that touches no course files (codex/bee-capacity-explanation, run 39132227960) and passed on others.

The matrix reads live board data. When I ran it from this container, which cannot reach t27.ai, I got sectors=0 everywhere, so a local run cannot confirm or rule out the cause. I cannot re-run the job from this session (403). The check is not required: the only required check is "T27 work report".


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Reviewer bee, round 2, head 3e0833d. Sound: merging. This addresses the defect from review 5565039954.

The defect is gone

  • No K_OUT_SIDES remains, and no OUT[ lookup either, in specs/widgets/nn-* or public/widgets/nn-*. I read through every other nn-* K_ constant. Each one is an input, a fixture, a preset, an axis bound or a display threshold, not a result of a spec fn.
  • tool.js imports outSide from ./logic.js, and draw() takes n = outSide(k, st). logic.js exports outSide (a W.t27_out_side wasm export). __NOT_LOWERED__ is still out_size, forward, backward, cfg. In node, outSide for (2,2), (3,1), (2,1), (4,1) gives [2, 2, 3, 1].
  • maxpool2d_layer.t27 is byte-identical in three places: t27 master (contents API), public/t27/files/specs/ml/layers/ and public/widgets/nn-maxpool/logic.t27. All three have sha256 12627dff…, which matches the spec-sha256 in logic.js. t27#10665 merged as 2e53089d57. compare 239b4b059...master lists that file as the only change under specs/ml/, so the other 26 vendored lesson specs still match master.
  • The widget spec has 3 tests: share size, the four kernel and stride pairs as literals, and the grid as the spec fixture. None of them re-derives out_size's formula.

The delta adds no new problem

Run locally on 3e0833d, all green:

  • check:widget-logic: 84 widgets
  • check:widget-pages: 166 pages; 511 spec tests with 1665 asserts
  • check:course: 10 courses; 270 lesson specs compile clean
  • check:course-pages: 9/9
  • check:widgets: 279 widgets

The EN and RU max-pooling pages changed only by embedding the new spec source. The added lines contain no superlatives, and RU digits still match (check:course).

CI

  • T27 work report (required) is a success. The report run that failed at 21:36 was superseded by a run on the edited event at 21:37, which succeeded. pr-blog-report.yml listens to edited.
  • checks (pure gates) and website gate are red the same way as on main b34a2b4 (run 39102139736).
  • checks (queen matrix, touch, dead API) is the known flake, explained in the comment above.

One note on the PR body (no action needed to merge)

The prose under Specification Link still says specs/ml/** is at master 239b4b059 for all 27 lesson specs. Since this head, maxpool2d_layer.t27 comes from 2e53089d5. The JSON report, the course spec, the widget's DATA_SOURCES and the page footer all say so correctly. Only this one prose line is out of date.


Generated by Claude Code

@gHashTag
gHashTag marked this pull request as ready for review October 18, 2026 21:55
@gHashTag
gHashTag merged commit 7c945f0 into main Oct 18, 2026
12 of 16 checks passed
@github-actions github-actions Bot added status:completed Done and removed status:in-progress 🔵 Agent working labels Oct 18, 2026
github-actions Bot added a commit that referenced this pull request Oct 18, 2026
feat(website): course 10, Neural networks in t27 -- 27 lessons, 27 widgets running compiled specs/ml (#1696)

* specs reader: a float with an exponent is a number; the gallery counts past 255

t27 specs/ml writes its epsilons as 1e-8, 1.0e-5 and -1.0e30. literalValue
refused that form, so constsOf threw on adam, attention_mechanism,
batchnorm_layer, binary_crossentropy_loss and lamb, and widget-logic could
not compare a widget's K_ numbers with them. The decimal pattern now takes
an optional exponent; hex and expressions are still refused, and a new test
says both.

WIDGET_COUNT becomes u16 in the gallery schema: the 27 widgets of course 10
take the gallery from 252 to 279, past what a u8 holds.

Refs #1695

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k

* widgets: 27 neural-network widgets, logic compiled from gHashTag/t27 specs/ml

Twenty-seven tool widgets, three per module of the neural-networks course:
activations (ReLU, sigmoid, tanh, GELU, Swish, ELU), softmax, embeddings and
dropout, pooling and batch norm, MSE, cross-entropy and Huber, SGD, RMSProp
and Adam, backpropagation, XOR and LAMB, a recurrent cell, LSTM gates and
attention, positional encoding, an encoder block and PPO. Each widget opens
with the question its lesson asks and computes nothing itself: its logic.js
is the fn bodies of one specs/ml spec of t27 master 239b4b059, compiled to
wasm by 999 scripts/t27-logic.mjs (usize lowered since 999#4017) and
imported with widget-logic.mjs --import. Words are SAY_ and numbers K_
constants of specs/widgets/<id>.t27; the widget specs hold integers only, so
a K_ name ending in _C is in hundredths.

nn-kit.js builds on dsp-kit.js (controls, presets, URL hash, tiles, plot
axes) and adds curves you drag along, bar charts, heat-maps, diverging and
heat colour scales and a node-link diagram. nn-conv is average pooling over
2 x 2 windows (pool4_at): the sliding conv2d spec, t27#10612, is not merged,
and the widget says so. nn-xor trains the spec's 2-8-1 network in the page
and shows the four inputs the spec exposes, not a decision region.

The gallery grows from 252 to 279 widgets; the new shelf sits before the
wars pin (index 244 to 270) and the pins after it move by 27. The 27 lesson
specs are vendored under public/t27/files/specs/ml byte for byte as t27
master; 24 of them replace older copies, read by no course or widget before.

Refs #1695

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k

* course: neural-networks, from one neuron to a transformer block

Course 10: nine modules and 27 lessons. It opens the parts the project's
agents think with, as the gHashTag/t27 specs/ml specs they are written in:
one neuron (ReLU, sigmoid, tanh), new bends (GELU, Swish, ELU), a layer
(softmax, embeddings, dropout), pictures (pooling, max pooling, batch
norm), the error (MSE, cross-entropy, Huber), downhill (SGD, RMSProp,
Adam), learning (backpropagation, XOR, LAMB), memory and attention (a
recurrent cell, LSTM gates, attention) and the transformer and the reward
(positional encoding, an encoder block, PPO). Each lesson asks a question,
opens one nn-* widget that answers it, and names the spec that computes it.
Lesson 10 says plainly that it is average pooling until t27#10612 merges.

The course is added last in courses.t27 (COURSE_COUNT 10, with a test that
it closes the catalogue), with the Russian contract neural-networks-ru.t27
and the bundle i18n/neural-networks.ru.json; the negative control of
course-from-spec.test.mjs moves from 10 to 11. Also regenerated: the learn
pages (EN and RU), cards, sitemap, the course and route tables, and the menu
entry.

Refs #1695

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k

* blog: neural networks in t27, a widget per lesson

The post (EN and RU) walks through the nine modules of course 10 and the
widget each lesson opens, explains how a specs/ml spec reaches the browser
(t27-logic.mjs, then widget-logic.mjs), and says what the course does not
show. Its figure is the XOR training loss of the 2-8-1 network and its four
outputs after 2000 epochs (0.8896 to 1.8e-13), drawn by the same compiled
mlp.t27 logic the nn-xor widget runs.

Refs #1695

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k

* widgets(nn-maxpool): the output side comes from the spec's out_side

The widget held the output sides as K_OUT_SIDES = [2, 2, 3, 1], which are
results of the spec fn out_size. A widget-spec test re-derived out_size's
formula by hand to hold them. Both broke the mirror law (review 5565039954).

- Vendor specs/ml/layers/maxpool2d_layer.t27 from t27 master 2e53089d5,
  byte-identical, into public/t27/files and nn-maxpool/logic.t27. That
  commit (gHashTag/t27#10665) added the lowerable fn out_side(kernel, stride).
- Lower it again with t27-logic.mjs and import it with widget-logic.mjs.
  logic.js now exports outSide.
- tool.js gets the output grid's shape and the "output n x n" tile from
  outSide(k, st).
- Drop K_OUT_SIDES and the test every_output_side_follows_from_kernel_and_stride.
  A new test, the_four_configs_are_the_spec_window_stride_pairs, holds the
  K_KERNELS/K_STRIDES inputs.
- The course spec says the max-pool spec is vendored from 2e53089d5. Widget
  pages and both max-pooling lesson pages are regenerated.

Course 10, #1695. Spec: gHashTag/t27#10665.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k

---------

Co-authored-by: Claude <noreply@anthropic.com>
gHashTag added a commit that referenced this pull request Oct 19, 2026
…ays (pure gates green) (#1700)

check:queen-fallback-parity failed 234/235 on main since 6e6c6df: .course-shelf wrote
var(--border, rgba(255, 255, 255, 0.12)) while --border is declared rgba(255, 255, 255, 0.08)
on :root (index.css:7). The token always resolves there, so the fallback was dead and the page
draws the same; now the fallback says what draws, and checks (pure gates) / website gate go
green for every website PR (red on #1696, #1699 and others).


Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k

Co-authored-by: Claude <noreply@anthropic.com>
github-actions Bot added a commit that referenced this pull request Oct 19, 2026
fix(website): the course shelf's border fallback says what --border says (pure gates green) (#1700)

check:queen-fallback-parity failed 234/235 on main since 6e6c6df: .course-shelf wrote
var(--border, rgba(255, 255, 255, 0.12)) while --border is declared rgba(255, 255, 255, 0.08)
on :root (index.css:7). The token always resolves there, so the fallback was dead and the page
draws the same; now the fallback says what draws, and checks (pure gates) / website gate go
green for every website PR (red on #1696, #1699 and others).

Claude-Session: https://claude.ai/code/session_01ScHVrGSr6zZUdwkdC8DR9k

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Course: Neural networks in t27, from one neuron to a transformer block

2 participants