GeezerVison is showing github.com — fix(id): make territory's view fit eight seats within the default fuel by dezren39 · Pull Request #248 · developing-today/code
Conversation
Summary
Fixes the bug found by #247: territory's styled view ran out of the 10M fuel limit with six or more seats (it allows eight), and a trapped view poisons the world. Stacked on #247.
- Territory's
view builds row strings and style runs and renders through a new Screen.render_rows_json, with no per-cell record list. The picture and the view JSON are byte-identical to before across six scripted states (0 to 8 seats, 0 to 14 cells per seat).
json_quote skips its per-byte fold when the text needs no escaping. The existing Screen API is unchanged.
- The checked-in modules were built by an older system
roc (nightly-2026-08-10), not the pinned nightly-2026-10-04 in nix/roc.nix. They are rebuilt with the pinned compiler: territory, roc-screen, roc-grid (the only examples that import Screen).
Territory view fuel
| State |
Before (checked in) |
Pinned Roc, old source |
After |
| empty board |
6,544,819 |
2,343,322 |
964,367 |
| 2 seats, 14 cells |
7,798,938 |
2,572,204 |
1,132,099 |
| 8 seats, 14 cells |
trap |
3,239,531 |
1,611,425 |
Full house is 16% of the limit; the target was 40%. roc-screen view 257,078 to 123,675, layout 1,192,583 to 378,384. roc-grid view 981,969 to 391,196.
Guards
territory_view_fits_the_default_fuel_with_every_seat_taken failed before the change with a fuel trap and now passes, asserting at most 40% of the limit.
- A
territory-full row in FUEL_BUDGETS (8 seats, 14 cells each) guards the full house with the same baseline-plus-25% rule. The territory, roc-screen, and roc-grid rows are re-baselined, for the reasons above.
Notes and open items
- A Roc wasm-backend hazard: reusing a
Str after Str.to_utf8 consumed it corrupts memory in the pinned nightly. roc test passed while the sandbox tests failed. The code rebuilds the Str from the bytes; the README records the hazard.
- Same-source builds produced different bytes across runs, so do not compare
.wasm files by hash.
roc-counter, tic-tac-toe, roc-chat, and lounge were not rebuilt (they do not import Screen) and may also come from the older compiler.
- Not done: a view trap should degrade to an error screen instead of poisoning the world (F11.17).
Validation
cargo test --lib: 1337 passed, 6 ignored (the subagent's run). I re-ran sandbox:: (29 passed, 2 ignored) and world_compile:: (19 passed).
cargo fmt --check: clean. Clippy via the rustup 1.97.0 cargo exits 0; plain cargo clippy fails with E0514 as before.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Territory's view cost 6.5M fuel on an empty board and 0.8M per seat, so six
or more seats trapped and poisoned the world. The checked-in module was built
by an older Roc than the pinned one; rebuilding alone saves about 4.2M. On
top of that, Screen.json_quote skips its per-byte fold for text that needs no
escaping, and the new Screen.render_rows_json / Screen.box_edge build the
screen document from whole rows without a per-cell record list. Territory's
view JSON is byte-identical to before.
Eight seats with 112 of 128 cells claimed now use 1.61M fuel (16 percent of
the limit). territory-full is added to FUEL_BUDGETS. territory, roc-screen
and roc-grid are re-baselined because their modules were rebuilt with the
pinned compiler and the cheaper Screen; rebuilt roc-screen and roc-grid are
cheaper by 52 and 60 percent on view.
coderabbitai
Bot
commented
Oct 17, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Note Currently processing new changes in this PR. This may take a few minutes, please wait...
⚙️ Run configuration
-
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a73f3ea9-0d98-47c3-beb4-02822d872693
📥 Commits
-
Reviewing files that changed from the base of the PR and between 8a8547b and 7cedd7f.
⛔ Files ignored due to path filters: 3
-
pkgs/id/examples/roc-grid/roc-grid.wasm is excluded by !**/*.wasm
pkgs/id/examples/roc-screen/roc-screen.wasm is excluded by !**/*.wasm
pkgs/id/examples/territory/territory.wasm is excluded by !**/*.wasm
📒 Files selected for processing: 5
-
doc/2026-10-17T16-30-00Z_fix_territory_view_fuel/2026-10-17T16-30-00Z_fix_territory_view_fuel.md
pkgs/id/examples/roc-world/README.md
pkgs/id/examples/roc-world/Screen.roc
pkgs/id/examples/territory/main.roc
pkgs/id/src/sandbox.rs
+---------------------------------------------------------+
| Nuke the bugs from orbit. It's the only way to be sure. |
+---------------------------------------------------------+
\
\ (\__/)
(•ㅅ•)
/ づ
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 18, 2026
This was referenced Oct 27, 2026
This was referenced Nov 13, 2026
This was referenced Nov 21, 2026
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|