8000 Declutter workshop UI and restore URL navigation by ysZXin · Pull Request #4 · chainhelen/neural-atelier · GitHub 8000
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ In **[Build one original encoder layer](https://hacking.pub/games/neural-atelier

The first five prologues provide fixed modules with **no wires connected**. Prologue 06, **[Use the FFN you just built](https://hacking.pub/games/neural-atelier/#workshop)**, starts with an **empty table**: drag in the ReLU FFN assembled in Prologue 05 and wire it yourself. Prologue 07 starts empty too: place that same FFN plus residual addition to compute X + FFN(X), with ReLU still inside. From Prologue 06 onward, building lessons keep the shelf available. Every subsequent Original-track puzzle starts with an empty table, even when its shelf has only one module. Drag the required components in, then wire them. Modern and engine lessons retain their prepared starts. Previously auto-filled Original boards with no connections are archived before opening an empty table; **Restore previous solution** recovers that layout. Connected boards and completed saves continue as before. Open construction levels allow multiple copies, each with independent connections. The shelf shows remaining stock and the table limit: **8** modules for the FFN, **12** for Attention, and **7** for the Transformer block. Each module type has two copies, except the FFN's four linear projections, which combine the formerly identical linear and content projection stocks. Returning a module restores its stock. Existing saves keep all copies, positions, and wires after the merge.

After completing a prologue, reopening or reloading it starts a fresh challenge. **Restore previous solution** brings back your last completed layout and wiring without running it. Unfinished attempts continue where you left off, including attempts at a level you have beaten before. **Replay level** in the completion dialog stays on your current board without resetting or running it. Original network puzzles, modern extensions, and engine levels continue to load saved circuits directly. The final **[Run the complete original Transformer](https://hacking.pub/games/neural-atelier/#transformer-demo)** demonstration always opens with all 67 basic operators placed and wired. Just press Run: one encoder layer, one decoder layer, two heads, four model features, ReLU FFNs, vocabulary probabilities and selection. The modules float in a three-dimensional space, without a board. Drag to orbit freely; Shift/right-drag or toggle **Pan view** to move the view; scroll to zoom around the pointer. Region buttons and double-click cards help you inspect the model. Its default 0.25× setting keeps each matrix column visible for about one second, matching the other lessons. There is no forced total-duration compression; pause or raise the speed for a faster overview. **Follow data** smoothly tracks the active computation during a run. Dragging, zooming or choosing a region returns control to you; turn following back on whenever you want. Modules and wiring stay fixed. Each new token feeds the next round; full text remains visible while matrices use a three-token rolling display window. Untrained weights can repeat tokens. Choose Wide, Medium or Close following; the camera returns to the model center at the end.
After completing a prologue, explicitly selecting it from another level starts a fresh challenge. **Restore previous solution** brings back your last completed layout and wiring without running it. Refreshing or using browser Back / Forward instead resumes the saved attempt, including its completion status; returning to the current level from the home or level menu keeps its board. Unfinished attempts continue where you left off, including attempts at a level you have beaten before. **Replay level** in the completion dialog stays on your current board without resetting or running it. Original network puzzles, modern extensions, and engine levels continue to load saved circuits directly. The final **[Run the complete original Transformer](https://hacking.pub/games/neural-atelier/#transformer-demo)** demonstration always opens with all 67 basic operators placed and wired. Just press Run: one encoder layer, one decoder layer, two heads, four model features, ReLU FFNs, vocabulary probabilities and selection. The modules float in a three-dimensional space, without a board. Drag to orbit freely; Shift/right-drag or toggle **Pan view** to move the view; scroll to zoom around the pointer. Region buttons and double-click cards help you inspect the model. Its default 0.25× setting keeps each matrix column visible for about one second, matching the other lessons. There is no forced total-duration compression; pause or raise the speed for a faster overview. **Follow data** smoothly tracks the active computation during a run. Dragging, zooming or choosing a region returns control to you; turn following back on whenever you want. Modules and wiring stay fixed. Each new token feeds the next round; full text remains visible while matrices use a three-token rolling display window. Untrained weights can repeat tokens. Choose Wide, Medium or Close following; the camera returns to the model center at the end.

At composition milestones such as **[Self-attention](https://hacking.pub/games/neural-atelier/#self-attention)**, a successful network gathers into one component and flies into the left shelf before the completion dialog appears. The collected component performs the same calculation and can be dragged into compatible building lessons. Your original layout stays saved. The animation can be paused or skipped and respects reduced-motion preferences.

Expand All @@ -93,7 +93,15 @@ Q/K/V projections use that same per-output animation for every token: the active

Moving vectors share a small tray with features arranged left to right, matching the input and output racks. A sequence keeps its token rows separate. You can rotate and zoom during execution; wiring and module placement stay locked until the run stops.

Progress and circuits are saved in this browser's `localStorage`. Links such as `#wire` or `#projection` select a level; they do not share your circuit or progress. The game requires a desktop browser with WebGL 2. Mobile layouts are not supported.
Progress and circuits are saved in this browser's `localStorage`, not in the URL. Navigation links use stable IDs in either language:

- `#wire` or `#encoder-layer` opens that level's workbench directly; existing level links still work.
- `#home?lesson=encoder-layer` opens the title screen with that current lesson.
- `#menu?lesson=encoder-layer&track=main&group=decoder&from=game` opens the level menu at a track and learning stage. `lesson` identifies the current board, not the menu's browsing position; `from=home` or `from=game` sets where closing the menu goes. Tracks without stages omit `group`.

Refresh and browser Back / Forward restore the page, track, stage and lesson. Browsing the menu does not reset your circuit or undo history; ordinary scrolling does not create navigation entries. Opening a URL without a hash shows the title screen with the saved current lesson. Leaving the workbench or changing lessons stops any running or paused animation, but keeps a completion already saved before its collection animation. Returning to another lesson loads its latest local circuit, not a historical edit snapshot. Sharing a link does not share wiring or completion records.

The game requires a desktop browser with WebGL 2. Mobile layouts are not supported.

## Run locally

Expand Down
10 changes: 8 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

序章前五关提供固定组件,**所有连线都需要自己接**。序章 06 **[用上刚组好的 FFN](https://hacking.pub/games/neural-atelier/#workshop)** 从**空台面**开始,要自己拖入序章 05 合成的 ReLU FFN,再接线。序章 07 也从空台面开始,拖出同一个 FFN 和残差相加,计算 X + FFN(X);ReLU 仍在 FFN 内部。从序章 06 起,搭建关会保留组件架。之后的原版基础解谜关从空台面开始,即使组件架只提供一种组件,也需要自己拖入、摆放并接线。现代扩展与引擎关保留各自的预设起点。旧版自动摆好但还没接线的原版起点会先存档再收回组件,可用“恢复上次方案”找回;已有连线或通关的存档继续保留。开放搭建关允许重复拿取,每类通常有两块;FFN 的线性投影有四块,合并了原来计算相同的“线性投影”和“内容投影”库存。FFN、Attention、完整层的台面上限分别为 **8、12、7** 块,组件架会显示余量。合并后已有存档保留全部组件、摆放和接线。

通关后的序章再次进入或刷新时会开启新挑战,可以主动点“恢复上次方案”找回上次通关的摆放和接线,不会自动运行。未完成的搭建仍然保存,即使这关以前通过也不会丢失。完成弹窗中的“重玩本关”保留当前棋盘,既不重置也不直接运行。原版网络、现代扩展和引擎关继续直接加载各自的存档。
通关后的序章,从另一关主动选入时会开启新挑战,可以点“恢复上次方案”找回上次通关的摆放和接线,不会自动运行。刷新或使用浏览器前进 / 后退会恢复已有尝试及其完成状态;从首页或选关页回到当前关卡也不会重置棋盘。未完成的搭建仍然保存,即使这关以前通过也不会丢失。完成弹窗中的“重玩本关”保留当前棋盘,既不重置也不直接运行。原版网络、现代扩展和引擎关继续直接加载各自的存档。

在 **[自注意力](https://hacking.pub/games/neural-atelier/#self-attention)** 等组合关卡中,全部输入通过后,棋盘上的网络会聚拢成一个组件,再飞入左侧组件架,之后才显示完成弹窗。新组件保留同样的计算,可在适用的搭建关卡中拖出使用。原来的搭建仍会保存。合成动画支持暂停、跳过,并适配系统的减少动态效果偏好。

Expand All @@ -80,7 +80,13 @@

FFN 的内容支路直接复用**线性投影**,卡片会说明“内容”是它的用途,并与使用另一套权重的**门投影**对照。**SwiGLU** 放在原版编码器—解码器之后的现代扩展中:先分别练权重、相乘、门控、降维,再学 RMSNorm,最后综合搭建。原有的关卡链接、接线和通关记录在调整顺序后仍然保留。

关卡和接线进度保存在当前浏览器的 `localStorage` 中。URL 中的 `#wire`、`#projection` 等只定位关卡,不携带自己的接线或通关记录。
关卡和接线进度保存在当前浏览器的 `localStorage` 中,而不在 URL 里。导航链接使用不随语言变化的稳定 ID:

- `#wire` 或 `#encoder-layer` 直接打开对应关卡的工作台,原有关卡链接继续有效。
- `#home?lesson=encoder-layer` 打开首页,并保留该关为当前关卡。
- `#menu?lesson=encoder-layer&track=main&group=decoder&from=game` 打开指定路线、学习阶段的选关页。`lesson` 表示当前棋盘,不是菜单的浏览位置;`from=home` 或 `from=game` 决定关闭菜单时返回首页还是工作台。没有学习阶段的路线省略 `group`。

刷新与浏览器前进 / 后退会恢复页面、路线、学习阶段和关卡。浏览选关页不会重置接线或撤销历史,普通滚动也不新增导航记录。没有 hash 的网址会显示首页,并使用已保存的当前关卡。离开工作台或换关会停止正在运行或暂停的动画,但合成动画前已保存的通关结果仍然保留。通过历史回到另一关时加载该关最新的本地接线,不是回退到某次编辑快照。分享链接不会分享接线或通关记录。

可以拖动模块调整位置或重新搭建。矩阵投影展示加权贡献;SiLU 则让数值沿弯曲通道通过,并按照 sigmoid 门值改变大小。

Expand Down
2 changes: 1 addition & 1 deletion cloud-curriculum.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions docs/images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@ These assets present Neural Atelier on the repository homepage.
The captures come from an earlier Chinese-language build. They are not captures of the current English interface. The cover adds typography around a gameplay capture; it does not depict a separate game screen.

To use the cover for GitHub link previews, upload `social-preview.png` in the repository's **Settings → General → Social preview**. Committing it to the repository does not configure GitHub's social preview automatically. The small owner avatar on GitHub is an account-level image, separate from this cover.

## Visual declutter comparison

`visual-declutter/` contains six unedited PNG browser captures taken on 2026-11-10 for the visual-declutter pull request. They are review evidence, not replacement homepage artwork.

- **Before:** clean upstream revision `a049375af9ea7ecad4758d35a66cdd40a9bb7f8f`.
- **After:** the visual, navigation and focus changes committed alongside these images.
- **Environment:** Orca embedded desktop browser on macOS, Simplified Chinese, 1440 × 900 CSS pixels, scale factor 1. Before and After use separate local origins and fresh per-level progress for these scenes.
- Each PNG preserves the entire viewport at its original size: no cropping, annotations or compositing. Scrollable menu and sidebar content outside the viewport is not stitched into the image. The game keeps its default rendering and animation behavior; moving decoration may be at a different animation frame.

| Pair | Matching scene and interaction |
| --- | --- |
| `home-before.png` / `home-after.png` | Home screen with `wire` selected. Tab once, then reload, reproduces the initial-focus outline before the fix; after the fix, the heading receives initial focus and Tab still focuses the entry button visibly. |
| `menu-before.png` / `menu-after.png` | Enter from Home; Main track, first learning stage, `wire` current, no completed lessons. The After image shows the denser cards and collapsed group explanation. |
| `encoder-before.png` / `encoder-after.png` | `encoder-layer`, no placed modules or connections, default camera/zoom and shelf size. The After image shows the wider shelf, shorter always-visible instructions, collapsed theory and chapter return button. |
Binary file added docs/images/visual-declutter/encoder-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/visual-declutter/encoder-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/visual-declutter/home-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/visual-declutter/home-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/visual-declutter/menu-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/visual-declutter/menu-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading
0