Files
raea/runtime/react/Cargo.toml
shaneandshinyobjectz 14cdac0687 Render memory: halcyon r109 from killed at 24-25 GB to a 7.8 GB peak (RM0-RM10) (#273)
* RM0: each App's meshes and images, CPU and GPU bytes, after every RAEA_MEM_MARKS mark (raea-sys-memtally); docs/render-memory.feature RM0-RM4

* RM1-RM10: halcyon r109's sequence from killed at 24-25 GB to a 7.8 GB peak (footprint 5.5 GB), the look within run-to-run noise

- RM1: materials' maps and Solari's traced meshes on the GPU only (RAEA_KEEP_CPU_ASSETS=1: the control)
- RM2: a sequence's first 3D engine let go before a second opens
- RM5: JS solids deduplicated by expression, their Manifolds in a two-generation cache (192 MB each); solid.free
- RM6: a map whose picture changes by frame is one part and one material, its picture swapped as frames show it
  (raea-sys-material swapped.rs): the pool's 96 water maps were 96 meshes and 186 textures
- RM7: Manifold shapes welded into indexed meshes (4.65 corners a vertex in halcyon; RAEA_NO_WELD=1: the control);
  a held frame settles to the same picture, boiling 0.30% against 0.38%
- the shape text kept out of the store and the Edit (the engine spawns from the program's rows)
- RM8: a BufferMesh of 64 KB or more kept on disk by its content (buffer:@NAME, raea's caches/buffers):
  shape text 274 MB -> 11.8 MB
- RM9: material maps as BC7 with their mips (intel_tex_2), cached by content in raea's caches/maps, any size
  resampled to whole blocks (RAEA_NO_BC=1: the control): GPU images 733 MB -> 282 MB
- RM10: raea-sys-contact's solids as bytes, a count and u16 surface points: 1.27 GB -> 0.37 GB mid-render
- memtally names the biggest GPU images; RAEA_MEM_MARKS prints the program's text by column and shape call
- tools/memprobe: memseq, heapwho/heapseq (malloc stack logging, holders.py), abenv/abseq/steadyab (A/B on one binary)

docs/render-memory.feature has each step's numbers and gates.

* raea-sys-memtally in tools/layers.toml: a system, as the layers gate asks

* Size: render-memory's eight over-limit crates and files allowed once at today's sizes (Shane 11-29, for 0.1.13): the folders hold other lanes' uncommitted GI/RT work, so they're split once that lands

* Fold render-memory's copies into what they copied (the dupes gate, 297/60 back to 293/57): one two-generation cache, raea_core_shape::Generations, for core/shape's meshes and runtime/calls' built Manifolds; swapped maps load their pictures with maps.rs's panel_picture; raea_io_home::write_whole for a file written whole or not at all (the BC7 maps first); spawn_sig(it, swapped) one function, its callers saying which; the store's spawn given its columns. Size allowances taken down to the folded sizes (solid.rs is back under 500)

* Split the five crates render-memory took past 2000 lines, each where it parts cleanly, so the next lane has room (the size and rask gates; the one-time allowance is gone):
- raea-core-tables (core/tables): a row's per-frame tables, from raea-sys-frame (re-exported there as tables)
- raea-runtime-ecs (runtime/ecs): raea/ecs on Bevy's ECS, from raea-runtime-calls (ecs.rs re-exports it)
- raea-sys-toon (systems/toon): toon surfaces and outlines, from raea-sys-material; its shaders keep the embedded path compositions name (raea_sys_material/toon.wesl)
- raea-render-plugins (engine/render/plugins): RaeaPlugins, from raea-render (engine.rs re-exports it as raea_plugins; the imports only it used are gone)
- raea-runtime-kinds (runtime/kinds): the rows of models, panels, decals, plates, fog, fire, splats, mesh sequences and grass, with placement and name_column, from raea-runtime-scene
maps.rs's inline and panel pictures move to maps/pictures.rs (re-exported, 422 lines left)

* Engine::open_in: a live engine (re)opened in its slot, the one there let go first (RM2 in one place, docs/render-memory.feature). raea-runtime-export's five opens go through it, so a fed render stepped again in the page's box keeps its AOVs as its first engine did; aov_on takes the engine in place. raea-runtime-export is back under its planned 2000 (LT1 and LX6 hold the rest)

* Drop the dependencies render-memory's splits left behind (cargo shear, CI's unused-dependencies gate): raea-render's eleven systems crates went with RaeaPlugins to raea-render-plugins, raea-runtime-calls's bevy with raea/ecs to raea-runtime-ecs, raea-sys-material's raea-core-shape with toon to raea-sys-toon. raea-render's cargo-shear ignore goes too: spawn.rs reads a mesh buffer through raea_core_shape::buffer_json now

---------

Co-authored-by: shinyobjectz <[email protected]>
2026-11-29 16:40:57 -08:00

88 lines
5.6 KiB
TOML

[package]
name = "raea-runtime-react"
version = "0.1.0"
edition = "2024"
description = "React inside Bevy: React's commits become Bevy entities, drawn by bevy_ui (raea-runtime-js)"
license = "FSL-1.1-ALv2"
[features]
# Bevy plugins (raea-bevy-plugins): physics, GPU particles, tweens; raea-bevy-sdk generates their TypeScript
bevy-plugins = ["dep:raea-bevy-plugins"]
avian = ["bevy-plugins", "raea-bevy-plugins/avian"]
hanabi = ["bevy-plugins", "raea-bevy-plugins/hanabi"]
tweening = ["bevy-plugins", "raea-bevy-plugins/tweening"]
default = ["h264", "av1", "scripts", "modules", "network", "ml"]
# ONNX models and Pocket TTS speech for compositions (raea-runtime-calls: raea-sys-ml and raea-sys-speech)
ml = ["raea-runtime-calls/ml"]
# the soft backend's H.264 (openh264): raea keeps it; the game player goes without and decodes video through
# AVFoundation (lightspeed R7)
h264 = ["raea-render/h264", "raea-io-media/h264"]
# raea-render's AV1 media backend: raea keeps it; the game player (--no-default-features) goes without (lightspeed R7)
av1 = ["raea-render/av1"]
# an HTML composition's <script>s and the TypeScript toolchain in process (raea-modules:
# swc and deno_ast, for js-exec, the module seam and the incremental bake's function spans): raea keeps both;
# the game player (--no-default-features) goes without (lightspeed R7)
scripts = ["surfaces", "raea-render/scripts"]
# app screens (`<Screen app>`, raea-runtime-page's screen.rs): a component on @raea/ui's react-dom in a raea-runtime-js root of its own.
# raea keeps it; the game player takes it only when asked (raea-app-game `--features player,surfaces`, which export-game checks)
surfaces = []
modules = ["raea-native/modules", "raea-runtime-bundle/modules"]
# the network (the engine's http(s) assets, the shell's net.*: ureq + rustls): raea keeps it; the game player
# goes without and reads the fonts its export packaged (raea-app-game FONTS)
network = ["raea-render/network", "raea-native/net"]
[dependencies]
raea-runtime-plugins = { path = "../../runtime/plugins" }
raea-runtime-view = { path = "../../runtime/view" }
raea-io-assets = { path = "../../io/assets" }
# the one native-call layer (registry, generated types, the V8 binding and web shims)
raea-native = { path = "../../engine/native", default-features = false }
# the JS engine React runs on (JavaScriptCore on Apple, QuickJS elsewhere)
raea-runtime-jsengine = { path = "../jsengine" }
# the one BRP layer (engine/bevy-world): shared.rs reads and writes React's values through it (B3 H4)
raea-bevy-world = { path = "../../engine/bevy-world" }
# the same Bevy and feature set as raea-render, so the two share one build
bevy = { version = "=0.20.0", default-features = false, features = ["std", "default_app", "default_font", "multi_threaded", "3d_bevy_render", "ui_bevy_render", "png", "tonemapping_luts", "ktx2", "zstd_rust", "jpeg", "webp", "gif", "bmp", "system_font_discovery"] }
serde_json = { version = "1", features = ["raw_value"] }
# the op wire: React's batches read (raw), the page's element tree diffed (tree)
raea-core-wire = { path = "../../core/wire" }
# the counting allocator's per-thread counts (ZeroHeap Z1): the op apply's and the JS flush's allocations
raea-core-alloc = { path = "../../core/alloc" }
# a composition's TSX bundled into the script the engine runs
raea-runtime-bundle = { path = "../../runtime/bundle" }
raea-core-scene = { path = "../../core/scene" }
# a long BufferMesh kept on disk by its content (read.rs names3d, docs/render-memory.feature RM8)
raea-core-shape = { path = "../../core/shape" }
xxhash-rust = { version = "0.8", features = ["xxh3"] }
raea-runtime-calls = { path = "../../runtime/calls" }
raea-runtime-shared = { path = "../../runtime/shared" }
raea-runtime-scene = { path = "../../runtime/scene" }
raea-sys-contact = { path = "../../systems/contact" }
raea-sys-light-meter = { path = "../../systems/light-meter" }
# the Blitz page (docs/blitz-bevy.feature), RAEA_PAGE=blitz until it is raea's page (B5)
raea-page = { path = "../../engine/page" }
raea-sys-page = { path = "../../systems/page" }
raea-runtime-twins = { path = "../../runtime/twins" }
raea-runtime-input = { path = "../../runtime/input" }
# raea: <Video>/<Audio> decoded natively at their source times (the platform's decoders, Symphonia)
raea-io-media = { path = "../../io/media", default-features = false, features = ["soft-audio", "apple"] }
# raea's native calls: Manifold solids (raea_render::shape) and the scene's rows; with raea-render's native feature (the page
# engine, media and GPU kernels it renders with), which its default features also bring but the game player's don't
raea-render = { path = "../../engine/render", default-features = false, features = ["native"] }
# the animation substrate (a frame-pure fork of Animato): motion's <Animate> declarations sampled from the frame clock
raea-core-animate = { path = "../../core/animate", features = ["bevy"] }
raea-sys-animate = { path = "../../systems/animate" }
# Bevy plugins compiled into the engine, each behind a feature (sdk/raea/docs/bevy-plugins.md); none by default
raea-bevy-plugins = { path = "../../engine/bevy-plugins", optional = true }
raea-sys-bake = { path = "../../systems/bake" }
# matchmove (`raea track`, matchmove.solve), its own crate
raea-runtime-track = { path = "../../runtime/track" }
# <BlenderShot> and <GodotShot>'s native calls (blender.shot, godot.shot)
raea-runtime-shots = { path = "../shots" }
# a composition's 2D context's host calls (canvas.measure, canvas.advances, canvas.read; layout-reads LR6)
raea-runtime-canvas = { path = "../canvas" }
[package.metadata.cargo-shear]
# raea-io-media is here for its features (h264), which the platform decoders raea-render reads take
ignored = ["raea-io-media"]