Skip to content

Refactor dense ECS storage and align render hot paths with Bevy - #14

Merged
Milky2018 merged 135 commits into
mainfrom
milky/ecs-dense-table-columns
Jul 22, 2026
Merged

Refactor dense ECS storage and align render hot paths with Bevy#14
Milky2018 merged 135 commits into
mainfrom
milky/ecs-dense-table-columns

Conversation

@Milky2018

Copy link
Copy Markdown
Collaborator

Summary

This branch combines the dense ECS table-column refactor with the performance and correctness work needed to use it in Bevy-shaped render hot paths.

  • replace optional-slot component tables with dense typed columns, one-shot ownership transfer, direct required-value fetches, and table-batched query traversal
  • migrate visibility, transform, sprite, camera, picking, asset, time, and PBR hot paths to the validated batch/value APIs
  • harden batch safety and ECS semantics for filtered rows, escaped mutable views, table-0 entities, same-reference replacement, despawn membership, and change detection
  • restore source-level render correctness for Camera2d picking/frusta, affine sprite transforms, dynamic shadow phase resolution, frame-local render storage, and PBR material capacity
  • upgrade the window/wgpu/WGSL dependency stack, use typed surface handles, synchronize pinned Bevy shader/assets, and refresh accepted visual references
  • update the Markdown issue tracker with performance experiments, API migrations, resolved toolchain blockers, and remaining external limitations

Why

The previous ECS representation stored component columns as optional per-row slots and paid repeated wrapper, lookup, and change-tracking costs in render-critical queries. Several early optimizations exposed deeper semantic hazards around ownership, filtered write authority, table migration, and change detection. This branch makes the storage/query boundary dense and explicit, then migrates only validated performance-sensitive consumers.

The render follow-ups fix correctness gaps found during representative Bevy example captures rather than introducing visual heuristics or shader workarounds.

Impact

Performance-sensitive systems can traverse dense table columns in batches while retaining explicit read/write and change-tick semantics. Existing public API migrations and behavior changes are documented in the linked ISS records and generated interfaces.

This is intentionally a draft because the branch is large and should receive focused review across ECS storage/safety, visibility and transform propagation, render/PBR lifecycle, and dependency/binding changes.

Validation

  • git diff --check origin/main...HEAD
  • moon test utils/utils_test.mbt --target native --release --deny-warn — 4/4 passed on the current default native backend
  • standard native frame-90 captures for examples/3d/transmission and the clearcoat multi-layer material path complete reproducibly after the WGSL 0.17 upgrade
  • representative 2D/3D example and performance captures are recorded in docs/issues, including many animated sprites, visibility, picking, shadows, PBR, and asset parity work
  • examples/3d/meshlet now compiles and captures without the former Moon compiler ICE; exact meshlet output remains blocked and is explicitly tracked by ISS-020

Known remaining blockers

  • ISS-020: exact Bevy meshlet visibility-buffer runtime still requires native R64Uint atomic storage-texture support
  • ISS-427: Homebrew ASan still deadlocks before main on this macOS host, while Apple ASan does not support LeakSanitizer
  • ISS-443: unrelated current-toolchain type-parameter method warnings still prevent treating a repository-wide --deny-warn run as green

Milky2018 added 30 commits July 15, 2026 14:54
@Milky2018
Milky2018 marked this pull request as ready for review July 22, 2026 02:22
@Milky2018
Milky2018 merged commit 0dbd911 into main Jul 22, 2026
2 of 4 checks passed
@Milky2018
Milky2018 deleted the milky/ecs-dense-table-columns branch July 22, 2026 02:30
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.

1 participant