The Frontier (fastbook ch.7–12), mobile fixes, district placards & tour polish#2
Conversation
The Frontier — a new area south of a river, six buildings / 22 panels, everything trained live and checked against the vendored book notebooks (reference/fastbook-master.zip, see AGENTS.md principle 7): - Refinement Gym (ch.7): normalization, label smoothing ((1-ε+ε/N) targets), mixup (λ∈0.5..1 like the book's pseudocode), TTA over five shifted views — racing an identically-initialized plain twin on the same batches - Taste Cinema (ch.8): DotProductBias with sigmoid_range and weight decay on a planted-structure ratings grid; dot-product desk, learned bias interpretation, factor projector vs planted genres - Decision Arboretum (ch.9): CART trees by variance reduction, the candidate-question audition, bagged forest, OOB error, importance - Tokenizer Mill + Sentiment Studio (ch.10-11): tokenize/numericalize pipeline with xxbos/xxunk + min-freq, live bag-of-words classifier (template corpus keeps function words class-balanced) - Echo Tower (ch.12): the book's LMModel2 on human numbers, next-word quiz on the held-out tail, most-common-token baseline, generation Mobile fixes: - D-pad arrows: one ▲ glyph CSS-rotated (no iOS emoji variants, no mixed glyph sizes); FE0E on play/pause/step glyphs - interiors clamp-follow the avatar like the street camera - panels: vertical-only scrolling, canvases shrink with aspect ratio, tables scroll inside their own box, drawpad gets touch-action:none World: district names are now lawn-sign placards (navy board, gold text) with decor cleared beneath; grass strips widened; tour 1-21. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ree walk, fmt fix From user review of the frontier build: - The Grown Tree: path-focused layout — the chosen apartment's walk is expanded and highlighted top-to-bottom, every untaken branch folds into a clickable stub (no more squished columns at any width) - fix fmt(): the trailing-zero strip was eating round integers (1700 -> "17", 1040 -> "104") across every panel - Forest Lookout: 'regrow the forest' refits 20 trees on fresh bootstrap draws — MAE/OOB/importance wobble live (sampling variance, the thing bagging tames); single tree stays deterministic by design - Review Reader: verdict re-reads as you type (the old 'read it' button re-classified the same text, so it looked dead) - plaza redesign: a network monument (3-4-3 layers, edges light up while the main model trains) on a DL WORLD plinth, plus a tour kiosk — press E beside it to ride a scripted express glide to stop (1); avatar now spawns next to the kiosk - '↓ THE FRONTIER' markers at the west and east bridges (the central sign is easy to miss on phones) - tour chevrons: continue past stop 15 to the T-junction, stop at Echo Tower (no arrows past the final stop) - loop pulses are now chips carrying the actual digits of the current mini-batch instead of abstract yellow dots - heavy training tests get explicit 30s timeouts (were flaking at the default 5s under machine load) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sentiment Studio stands across the x30-31 column, so the central vertical road's continuation to the south road was a dead-end stub against the building's roof. The avenue now stops at the frontier's first road; the west/east edge roads remain the through-routes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Align it with Taste Cinema (x22), clearing the x30-31 column so the central avenue connects the north road to the frontier's bottom road in one straight run — the proper fix for the earlier dead-end stub. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 29 minutes and 42 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR introduces the Frontier, a substantial expansion adding four new machine-learning training scenarios, synthetic dataset generators, interactive UI panels, decision-tree/forest models, world geography expansion, and an express-tour mechanic. The implementation progresses from data utilities through scenario implementations, world integration, comprehensive UI instrumentation, city geography, game mechanics, and testing. ChangesFrontier ML Models & Interactive Learning Environment
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes The PR introduces substantial new functionality across multiple domains (data generation, ML model implementations, UI panels, world mechanics) with moderate logic density. While individual components follow clear patterns, the breadth of changes (5 new UI modules, tabular models, game mechanics, city expansion) and interconnected dependencies require careful review of each checkpoint. The implementation is self-contained but dense enough to demand thorough inspection of scenario semantics, tree-fitting correctness, UI wiring, and game-state management.
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/sim/tabular.ts`:
- Around line 187-208: oobMae and predictForest currently divide by
counted/trees.length without guarding against zero, causing NaN; update oobMae
(function oobMae, referencing forest.trees, forest.bags and predictTree) to
return a safe numeric default (e.g. 0) when counted === 0 before doing total /
counted, and update predictForest (function predictForest, which calls
predictTree) to return the same safe default when trees.length === 0 before
dividing; keep existing aggregation logic otherwise.
In `@tests/frontier.test.ts`:
- Around line 28-42: The loadMnistFromDisk() helper lacks validation of the
MNIST file magic number; update loadMnistFromDisk to read and verify the first 4
bytes/magic (e.g., "DLW1") before proceeding with offsets and throw a clear
format/error when it doesn't match so corrupt files fail fast; locate and mirror
the validation approach used in tests/training.test.ts but implement it inside
loadMnistFromDisk (reference function name loadMnistFromDisk and the
DataView/Uint8Array buffer handling) and ensure the error message clearly
indicates an invalid MNIST magic/header.
- Line 156: The test hard-codes the feature index as 1 when asserting feature
importance (expect(Math.max(...imp)).toBe(imp[1])); change it to derive the
index from the feature names instead of a literal: compute sizeIdx =
TAB_FEATS.indexOf("size m²") (and assert sizeIdx !== -1) then use
expect(Math.max(...imp)).toBe(imp[sizeIdx]); this keeps the assertion robust if
TAB_FEATS or feature ordering from makeTabularData()/featureImportance()
changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f21c6bc1-f3f3-4eb2-ac93-f781ef761021
⛔ Files ignored due to path filters (1)
reference/fastbook-master.zipis excluded by!**/*.zip
📒 Files selected for processing (24)
AGENTS.mdREADME.mdsrc/main.tssrc/sim/datasets.tssrc/sim/scenarios.tssrc/sim/scenarios2.tssrc/sim/tabular.tssrc/sim/world.tssrc/style.csssrc/ui/hud.tssrc/ui/panels/arbor.tssrc/ui/panels/collab.tssrc/ui/panels/common.tssrc/ui/panels/echo.tssrc/ui/panels/index.tssrc/ui/panels/language.tssrc/ui/panels/refinery.tssrc/ui/touch.tssrc/ui/widgets.tssrc/world/buildings.tssrc/world/city.tssrc/world/game.tstests/frontier.test.tstests/training.test.ts
…t index in tests - predictForest/oobMae return 0 instead of NaN when there are no trees or no out-of-bag rows to score - frontier test loader validates the DLW1 magic like the training tests - feature-importance assertion derives the size column from TAB_FEATS instead of hard-coding index 1 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
What this adds
🌉 The Frontier — fastbook chapters 7–12 as a new city area
The map extends south across a river into the Frontier, where the data stops being images. Six new buildings, 23 inspection panels, four new live trainers — every number on screen still comes from real tensors training in the tab. Models were checked against the actual book notebooks, now vendored at
reference/fastbook-master.zip(AGENTS.md instructs future agents to read the chapters before building on them):DotProductBias(factors + biases +sigmoid_range(0,5.5)) with weight decay on a planted-structure ratings grid; dot-product desk, learned-bias interpretation, factor projector vs planted genresLMModel2on human numbers, next-word quiz on the held-out tail, most-common-token baseline, greedy/sampled generationFrontier datasets are deterministic generators with planted structure + noise — models must rediscover it live, which lets panels honestly compare planted truth vs learned parameters.
📱 Mobile fixes
touch-action: none— dragging paints instead of scrolling🪧 World & tour polish
fmt()bug that truncated round integers everywhere (1700 → "17")Testing
npm test: 29/29 (gradient checks, training smoke tests, new frontier scenario/tree/generator tests)tsc --noEmitand production build clean🤖 Generated with Claude Code
Summary by CodeRabbit