Files
raea/engine/render/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

100 lines
8.2 KiB
TOML

[package]
name = "raea-render"
version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
publish = false
description = "raea's render engine: an edit's rows drawn by Bevy (3D) or the direct GPU path, its sound mixed, its video encoded"
[dependencies]
dunce = "1"
# a frame's rows as the passes read them (FrameRows, the edit, the clock, row helpers, bevy_api)
raea-sys-frame = { path = "../../systems/frame" }
# the engine's shaders read from files as an Engine opens, and their constants set from TypeScript (NB5b, NB1a)
raea-sys-engine-shaders = { path = "../../systems/engine-shaders" }
# a part held where a hand has it, and wireframe (the app's scene inspector)
raea-sys-hold = { path = "../../systems/hold" }
# the passes, each a crate of its own (systems/)
raea-sys-splat = { path = "../../systems/splat" }
raea-sys-sprite = { path = "../../systems/sprite" }
# soft shadows (experimental_pbr_pcss) are under the native feature with raea-runtime-scene3d/pcss: WebGPU refuses their sampling
bevy = { version = "=0.20.0", default-features = false, features = ["std", "default_app", "multi_threaded", "3d_bevy_render", "ui_bevy_render", "png", "tonemapping_luts", "ktx2", "zstd_rust"] }
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "hdr"] }
# an edit as rows keyed per frame, and 3D shapes as values (docs/media.feature M2)
raea-core-facts = { path = "../../core/facts" }
raea-core-program = { path = "../../core/program" }
# procedural surfaces on a mesh row (`proc`)
raea-sys-procmat = { path = "../../systems/procmat" }
raea-core-shape = { path = "../../core/shape" }
# text in the 3D world (<RichText>): each glyph a lit, shaded entity
raea-sys-text3d = { path = "../../systems/text3d" }
raea-runtime-gpuframe = { path = "../../runtime/gpuframe", optional = true }
raea-runtime-scene3d = { path = "../../runtime/scene3d" }
raea-runtime-plugins = { path = "../../runtime/plugins" }
raea-sys-screen = { path = "../../systems/screen" }
raea-sys-matchmove = { path = "../../systems/matchmove" }
raea-sys-grid = { path = "../../systems/grid" }
# the view a camera on the Engine's target draws: the frame above its tag row, or a page's box (#130)
raea-sys-viewbox = { path = "../../systems/viewbox" }
raea-sys-meshseq = { path = "../../systems/meshseq" }
raea-sys-environment = { path = "../../systems/environment" }
raea-sys-look = { path = "../../systems/look" }
raea-sys-compose = { path = "../../systems/compose" }
raea-sys-material = { path = "../../systems/material" }
raea-sys-toon = { path = "../../systems/toon" }
# raea's modules as Bevy plugins (RaeaPlugins), a crate of their own
raea-render-plugins = { path = "plugins" }
raea-sys-memtally = { path = "../../systems/memtally" }
raea-sys-shader = { path = "../../systems/shader" }
# three.js's shaders: a ShaderMaterial's GLSL and a node material's WGSL (docs/r3f.feature R3F11)
raea-sys-three-shader = { path = "../../systems/three-shader" }
raea-sys-post = { path = "../../systems/post" }
raea-sys-fog = { path = "../../systems/fog" }
# a field of grass made in tiles by distance (<Grass>)
raea-sys-grass = { path = "../../systems/grass" }
serde_json = { version = "1", features = ["float_roundtrip"] }
# the direct render's views, the 2D rows, clips' masks and the paint device (runtime/view)
raea-runtime-view = { path = "../../runtime/view", optional = true }
raea-sys-page = { path = "../../systems/page", optional = true }
# the shared device; its passes' errors, stalls and latency in the run's trace, as raea-render's
raea-gpu-device = { path = "../../gpu/device", optional = true }
raea-io-trace = { path = "../../io/trace", optional = true }
# the same wgpu Bevy uses (the NV12 pass records on its device)
wgpu = "=30.0.1"
bytemuck = "1"
# the media plane: clips decode through a MediaBackend (soft everywhere, apple on Apple)
raea-io-media = { path = "../../io/media", default-features = false, features = ["soft-audio", "apple"], optional = true }
# Bevy's Solari and MetalFX's denoiser on it (the raytracing feature)
raea-render-raytrace = { path = "raytrace", optional = true }
[features]
# native: everything that only exists to render on the machine itself (clips' decoders, the GPU frame path and its
# traces, the direct views, and Bevy's built-in font, JPEG, SMAA's and area lights' tables and gamepads, which a
# page's download goes without); without it raea-render is the program format and the 3D engine, which is what a browser build needs (docs/web-export.md, milestone 1)
native = ["bevy/default_font", "bevy/jpeg", "bevy/smaa_luts", "bevy/area_light_luts", "bevy/bevy_gilrs", "dep:raea-sys-page", "bevy/experimental_pbr_pcss", "raea-runtime-scene3d/pcss", "dep:raea-runtime-gpuframe", "dep:raea-runtime-view", "raea-sys-matchmove/native", "raea-sys-frame/native", "raea-sys-splat/native", "raea-sys-material/native", "raea-sys-text3d/native", "dep:raea-io-media", "dep:raea-gpu-device", "dep:raea-io-trace"]
# web: the 3D engine on WebGPU in a browser (wasm32-unknown-unknown, without native)
web = ["bevy/webgpu"]
# AV1 (dav1d decode, rav1e encode) as a media backend: on by default; an exported game's player goes without it
# (lightspeed R7: about 1 MB of code no game uses)
default = ["native", "h264", "av1", "scripts", "network"]
# Bevy's Solari, ray-traced lighting and its reference path tracer (docs/raytracing.feature RT3), and MetalFX's
# denoiser on it on the Mac (RT4)
raytracing = ["native", "dep:raea-render-raytrace"]
# the soft backend's H.264 (openh264): mezzanines, raea-render export's GOPs, portable video decode; an exported game's
# player goes without it and decodes video on the platform (lightspeed R7)
h264 = ["native", "raea-io-media/h264"]
av1 = ["native", "raea-io-media/av1"]
# an HTML composition's <script>s and its http(s) assets (Google Fonts, CDN images): the native build always has both, so
# these name what a build wants and add nothing to native
scripts = ["native"]
network = ["native"]
# every Bevy feature a game developer or animator might use: the plugin catalog's "bevy" declaration
# (sdk/raea/bench/bevy-plugins/package.json, 0.20). Measured beside the default build before it joins `default`
# (the adopt-0.20 pass, docs/bevy-upgrade.md); native only, so the web build goes without
# (but compressed_image_saver: ctt's AVX2 encoders set up C++ tables before main on any CPU, so raea.exe stopped at
# start on a PC without AVX; sdk/raea/docs/bevy-plugins.md)
bevy-all = ["bevy/bevy_gilrs", "bevy/gamepad", "bevy/area_light_luts", "bevy/experimental_pbr_pcss", "bevy/dfg_lut", "bevy/smaa_luts", "bevy/tonemapping_luts", "bevy/bluenoise_texture", "bevy/bevy_gizmos", "bevy/bevy_gizmos_render", "bevy/bevy_dev_tools", "bevy/debug", "bevy/bevy_ui_debug", "bevy/file_watcher", "bevy/embedded_watcher", "bevy/asset_processor", "bevy/png", "bevy/jpeg", "bevy/ktx2", "bevy/zstd_rust", "bevy/basis-universal", "bevy/exr", "bevy/hdr", "bevy/webp", "bevy/dds", "bevy/tga", "bevy/bmp", "bevy/gif", "bevy/ico", "bevy/qoi", "bevy/pnm", "bevy/tiff", "bevy/picking", "bevy/bevy_picking", "bevy/mesh_picking", "bevy/sprite_picking", "bevy/ui_picking", "bevy/meshlet", "bevy/meshlet_processor", "bevy/bevy_solari", "bevy/bevy_animation", "bevy/gltf_animation", "bevy/morph", "bevy/morph_animation", "bevy/bevy_gltf", "bevy/bevy_sprite", "bevy/bevy_sprite_render", "bevy/2d_bevy_render", "bevy/3d_bevy_render", "bevy/ui_bevy_render", "bevy/bevy_ui_widgets", "bevy/bevy_feathers", "bevy/custom_cursor", "bevy/bevy_input_focus", "bevy/bevy_camera_controller", "bevy/free_camera", "bevy/pan_camera", "bevy/bevy_text", "bevy/system_font_discovery", "bevy/scene", "bevy/bevy_state", "bevy/serialize", "bevy/reflect_functions", "bevy/reflect_documentation", "bevy/sysinfo_plugin", "bevy/bevy_clipboard", "bevy/system_clipboard", "bevy/clipboard_image", "bevy/ghost_nodes", "bevy/bevy_settings", "bevy/shader_format_spirv", "bevy/bevy_debug_stepping", "bevy/bevy_world_serialization", "bevy/bevy_audio", "bevy/mp3", "bevy/flac", "bevy/vorbis", "bevy/wav", "bevy/aac", "bevy/mp4", "bevy/http", "bevy/https", "bevy/web_asset_cache", "bevy/bevy_curve", "bevy/complex_script_segmentation", "bevy/compressed_image_saver_universal", "bevy/pan_orbit_camera", "bevy/pan_orbit_gizmo", "bevy/render_dev_tools"]
# per-system spans as a chrome trace (RUST_LOG=info, trace-*.json in the working directory)
trace = ["bevy/trace", "bevy/trace_chrome"]