Skip to content

Packed chunk#46

Merged
dsrw merged 44 commits intomainfrom
packed-chunk
Feb 5, 2026
Merged

Packed chunk#46
dsrw merged 44 commits intomainfrom
packed-chunk

Conversation

@dsrw
Copy link
Collaborator

@dsrw dsrw commented Feb 4, 2026

Fixes #39.

dsrw and others added 30 commits January 7, 2026 21:52
- Use libbacktrace for stack traces instead of Nim's slow default
- Configure minimal debug symbols (-g1 for GCC, -gline-tables-only for Clang)
- Fix chronicles exception logging: use `e` not `e[]` to avoid SIGSEGV

Chronicles has special handling for `ref Exception` that extracts .msg,
but dereferencing with `e[]` causes it to serialize the full Exception
object including problematic fields like parent and trace.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update dependency to fork with wai_getModulePath fix, add atlas docs
- Extract voxel management into VoxelStore module for testability
- Add packed_chunks module with RLE compression for network sync
- Add disable_packed_chunks runtime flag to GameState
- Two-tier sync: packed_chunks (snapshots) + chunk_deltas (incremental)
- Tests show 3.5-65x bandwidth reduction vs unpacked format

Co-Authored-By: Claude <noreply@anthropic.com>
- Add content_bytes field to VoxelStore to track actual voxel data size
- Update tests to report sent/recv/content separately
- Shows model_citizen overhead is 93-94% for sparse/delta cases

Co-Authored-By: Claude <noreply@anthropic.com>
Individual Chunk objects were being created with default
{SyncLocal, SyncRemote} flags, causing voxel data to sync
over the network in addition to packed_chunks/chunk_deltas.
- Add Timestamp and Duration types to vmlib/enu/types.nim
- Add now() function that returns seconds since program start
- Bridge now_seconds() to host for implementation
- Add timing_test.nim VM test
- Move "Connected to server" log inside try block so it only logs on success
- Add nph formatter dependency
- Stop ignoring bin/ directory
- bin/docs.nim: Local server for enu, godot-voxel, and godot docs
- build_bin task: Compile all nim files in bin/
- build_docs task: Build all documentation sets
- Track voxel changes in pending_changes table as they happen
- Deltas use tracked changes directly (no chunk rebuild needed)
- Snapshots queued for rate-limited processing (2/frame per build, 32 global)
- Snapshot triggers: 100+ deltas, 100+ changes per update, new chunk, or empty
- Remove last_snapshot field (no longer needed with direct tracking)
- Skip tracking for chunks already queued for snapshot
- Add ASAP constant and asap template for instant voxel placement
- End ASAP mode when switching targets via move/build templates
- Add runner field to Code type to track which context executes scripts
- Add server_ctx_name as SyncLocal ZenValue for cross-thread access
- Use runner check instead of Server flag for code execution and ScriptRunning
- Use rate limit constants directly, remove unused per-frame config fields
- Optimize bot velocity: set once at start instead of touching every frame
- Make collisions SyncLocal, adjust worker tick rate to 30-60fps
- Replace echo statements with proper info/notice logging
- Isolate chronos_httpserver in metrics_server.nim to avoid gdobj conflict
- Replace collect macro with manual seq building (stricter checks)
- Remove zen_debug_messages stats tracking from worker
- Add dump_stats VM binding for metrics inspection
- Clean up test file to remove zen_debug_messages references
- Single paste() call instead of per-voxel set_voxel reduces mesh updates
- Replace MAX_BLOCK_COUNT (100k) with MAX_BUILD_DIMENSION (65535 per axis)
- Add bulk_paste_done flag to skip redundant draws after paste
- Remove invalid script_ctx.asap_mode references
- Consolidate voxels.nim: packed chunk encoding, VoxelStore, VoxelRenderer
- VoxelRenderer decodes snapshots/deltas directly to VoxelBuffer
- Add ChunkFormat enum, use snake_case for stdlib varints
- Add Table.init template to core.nim
- Remove old packed_chunks.nim, voxel_store.nim
- Update build_node to use VoxelRenderer instead of local_voxels reads
Update all enum values to follow Ruby-like conventions:
- Colors, Theme, VoxelKind
- LocalStateFlags, GlobalStateFlags, LocalModelFlags, GlobalModelFlags
- Tools, TaskStates, QuitKind
- ACTION_COLORS, IR_BLACK constants

Document casing conventions in CLAUDE.md.
- Add api_docs.nim module for parsing jsondoc output and generating
  Mustache-compatible JSON for API documentation
- Add ed.nim nimibook entry point (works like book.nim)
- Add ed_readme.nim and ed_api.nim nimib documents
- Add api.html.mustache template with Ed-specific sidebar navigation
- Add api.css for API documentation styling
- Update enuib.nim with use_api_docs and use_ed_readme themes
- Update tasks.nim docs task to build Ed docs and copy to /ed/ directory

Ed docs will appear at https://getenu.com/ed after enu-site is pushed.
Paste buffered voxels every 2 seconds during ASAP mode when voxel_tasks
is low enough, showing visual progress during large builds. Worker loop
no longer blocks on voxel_tasks during ASAP mode.
…oad grouping

- Add Nim syntax highlighting with highlight.js
- Use IBM Plex Mono and Jost fonts
- Group overloads by doc comments
- Strip pragmas from code display
- Style improvements for code blocks and README
- ASAP mode (local): buffer + periodic paste every 2s for visual feedback
- ASAP mode (remote): buffer only, final paste when ASAP_MODE removed
- Non-ASAP mode: direct set_voxel (unchanged behavior)

Both local and remote follow the same buffering code path during ASAP
mode; only local does periodic pastes for progress visualization.
Watchers only fire for changes, not existing data. Added initial
render pass for packed_chunks and chunk_deltas so clients connecting
to existing builds see the voxels.
dsrw added 3 commits February 4, 2026 19:50
- Sidebar:
  - Move Expand/Collapse toggle to right side
  - Implement smart expand/collapse logic (expand on click, collapse if already viewed)
  - Color Types Lavender (#C6C5FE) and Functions White (#F6F3E8)
- Main Headers:
  - Force function headers to White (#F6F3E8)
  - Split Class Method headers (Type.method) into Lavender Type and White Method
@dsrw dsrw merged commit 053bb3e into main Feb 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"PackedChunk" format

1 participant