Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.
TypeScript 3dagent-skillsai-agentsai-videobevyclaude-codegame-enginegpulinuxmacosmotion-designmotion-graphicsreactrusttypescriptvideo-editingvideo-renderingwgpuwindows
FC0a: ui/ui_scaling (SSIM 0.9999; UiScale holds at 1 until an arrow key) and ui/layout/anchor_layout (0.9974; an absolute label's auto margins leave it at its static position, in Bevy as in CSS) pass
shinyobjectz9e3f99ff5483
diff --git a/bench/bevy-parity/examples.list b/bench/bevy-parity/examples.listindex fcb0cc1b..2b7e2cec 100644--- a/bench/bevy-parity/examples.list+++ b/bench/bevy-parity/examples.list@@ -76,3 +76,5 @@ ui/relative_cursor_positionui/ui_target_cameraui/text/text_wrap_debugui/layout/grid+ui/ui_scaling+ui/layout/anchor_layoutdiff --git a/bench/bevy-parity/runs.tsv b/bench/bevy-parity/runs.tsvindex 6bbad3fd..77f97649 100644--- a/bench/bevy-parity/runs.tsv+++ b/bench/bevy-parity/runs.tsv@@ -75,3 +75,5 @@ ui/relative_cursor_position - 10ui/ui_target_camera - 10ui/text/text_wrap_debug - 10ui/layout/grid - 10+ui/ui_scaling - 10+ui/layout/anchor_layout - 10diff --git a/docs/bevy-parity.md b/docs/bevy-parity.mdindex 309a5243..7724c369 100644--- a/docs/bevy-parity.md+++ b/docs/bevy-parity.md@@ -4,7 +4,7 @@ Bevy v0.20.0's examples against their raea TSX ports (docs/control.feature FC0a)don't edit. An example passes when every probed frame passes pixels (SSIM 0.98 and no 32 px tile off by more than 24 of 255) and cost (batch keys andframe time at most 1.25x the example's). Wall time is one machine's, measured in the same run.-Examples: **438**, ported **76**, passing **72**, excluded **16** (docs/bevy-parity/excluded.tsv), left **350**.+Examples: **438**, ported **78**, passing **74**, excluded **16** (docs/bevy-parity/excluded.tsv), left **348**.raea's frame ms is its update's plus the time React takes to step a frame for its 3D (step), which the exampledoesn't pay.@@ -132,6 +132,8 @@ doesn't pay.| ui/ui_target_camera | 10 | 0.998769 | 7 | 0 / 0 | 452 / 492 | 5 / 7 | 1 / 1 | 39.413 / 1.71 = 1.71 + 0 | yes | || ui/text/text_wrap_debug | 10 | 0.986254 | 15 | 0 / 0 | 589 / 492 | 5 / 7 | 1 / 1 | 32.74 / 1.068 = 1.068 + 0 | yes | || ui/layout/grid | 10 | 0.995059 | 14 | 0 / 0 | 482 / 492 | 5 / 7 | 1 / 1 | 34.457 / 1.496 = 1.496 + 0 | yes | |+| ui/ui_scaling | 10 | 0.999856 | 5 | 0 / 0 | 446 / 492 | 5 / 7 | 1 / 1 | 37.383 / 2.14 = 2.14 + 0 | yes | |+| ui/layout/anchor_layout | 10 | 0.997421 | 9 | 0 / 0 | 468 / 492 | 5 / 7 | 1 / 1 | 33.145 / 1.417 = 1.417 + 0 | yes | |## Excludeddiff --git a/docs/bevy-parity/results.jsonl b/docs/bevy-parity/results.jsonlindex 22fdcb77..b342a140 100644--- a/docs/bevy-parity/results.jsonl+++ b/docs/bevy-parity/results.jsonl@@ -119,3 +119,5 @@{"example":"ui/ui_target_camera","frame":10,"ssim":0.998769,"tile":7,"bevy":{"batch_keys":0,"entities":452,"extents":[],"frame":10,"frame_ms":39.413,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.71,"step_ms":null,"cost_ms":1.71},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/text/text_wrap_debug","frame":10,"ssim":0.986254,"tile":15,"bevy":{"batch_keys":0,"entities":589,"extents":[],"frame":10,"frame_ms":32.74,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.068,"step_ms":null,"cost_ms":1.068},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}{"example":"ui/layout/grid","frame":10,"ssim":0.995059,"tile":14,"bevy":{"batch_keys":0,"entities":482,"extents":[],"frame":10,"frame_ms":34.457,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.496,"step_ms":null,"cost_ms":1.496},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/ui_scaling","frame":10,"ssim":0.999856,"tile":5,"bevy":{"batch_keys":0,"entities":446,"extents":[],"frame":10,"frame_ms":37.383,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":2.14,"step_ms":null,"cost_ms":2.14},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}+{"example":"ui/layout/anchor_layout","frame":10,"ssim":0.997421,"tile":9,"bevy":{"batch_keys":0,"entities":468,"extents":[],"frame":10,"frame_ms":33.145,"materials":1,"mesh_entities":0,"meshes":5,"other_material":0,"visible":0},"raea":{"frame":17,"entities":492,"mesh_entities":0,"visible":0,"meshes":7,"materials":1,"batch_keys":0,"other_material":0,"extents":[],"frame_ms":1.417,"step_ms":null,"cost_ms":1.417},"pixels":true,"draws":true,"time":true,"pass":true,"why":""}diff --git a/sdk/raea/bench/bevy-parity/ui/layout/anchor_layout.tsx b/sdk/raea/bench/bevy-parity/ui/layout/anchor_layout.tsxnew file mode 100644index 00000000..0c6bd989--- /dev/null+++ b/sdk/raea/bench/bevy-parity/ui/layout/anchor_layout.tsx@@ -0,0 +1,43 @@+// Bevy v0.20.0 examples/ui/layout/anchor_layout.rs in raea's TSX: a black 3 x 3 grid filling the window (12 px padding+// and gaps), each cell a 0.25 grey box holding one absolute pink label (block, 5 x 1 px padding) anchored by offsets+// and auto margins to a corner, an edge's middle or the centre, its two lines in black FiraSans-Bold saying how. Bevy's+// Camera2d over the default clear colour is the layered <Canvas3D>. In Bevy's default 1280 x 720 window.+import { AbsoluteFill, Composition, registerRoot, staticFile } from "raea";+import { Canvas3D } from "raea/3d";+import { GridPlacement, Node, RepeatedGridTrack, Text, UiRect, percent, px } from "raea/ui";+import { Srgba } from "raea/color";++const FONT = staticFile("fonts/FiraSans-Bold.ttf");+const MARGIN = px(12);+const AUTO = "auto" as const;+type Anchor = { left?: ReturnType<typeof px>; right?: ReturnType<typeof px>; top?: ReturnType<typeof px>; bottom?: ReturnType<typeof px>; margin?: UiRect };+const ROWS: [string, Anchor][] = [+ ["left: 10px\ntop: 10px", { left: px(10), top: px(10) }],+ ["center: 10px\ntop: 10px", { margin: UiRect.horizontal(AUTO), top: px(10) }],+ ["right: 10px\ntop: 10px", { right: px(10), top: px(10) }],+ ["left: 10px\ncenter: 10px", { left: px(10), margin: UiRect.vertical(AUTO) }],+ ["center: 10px\ncenter: 10px", { margin: UiRect.AUTO }],+ ["right: 10px\ncenter: 10px", { right: px(10), margin: UiRect.vertical(AUTO) }],+ ["left: 10px\nbottom: 10px", { left: px(10), bottom: px(10) }],+ ["center: 10px\nbottom: 10px", { margin: UiRect.horizontal(AUTO), bottom: px(10) }],+ ["right: 10px\nbottom: 10px", { right: px(10), bottom: px(10) }],+];++function Shot() {+ return (+ <AbsoluteFill>+ <Canvas3D layered clearColor="rgb(43, 44, 47)" />+ <Node width={percent(100)} height={percent(100)} padding={UiRect.all(MARGIN)} row_gap={MARGIN} column_gap={MARGIN} display="Grid" grid_template_columns={[RepeatedGridTrack.fr(3, 1)]} grid_template_rows={[RepeatedGridTrack.fr(3, 1)]} background_color={new Srgba(0, 0, 0)}>+ {ROWS.map(([label, anchor]) => (+ <Node key={label} grid_column={GridPlacement.span(1)} grid_row={GridPlacement.span(1)} background_color={new Srgba(0.25, 0.25, 0.25)}>+ <Node display="Block" padding={UiRect.axes(px(5), px(1))} position_type="Absolute" {...anchor} background_color={new Srgba(1, 0.066, 0.349)}>+ <Text font={FONT} color={new Srgba(0, 0, 0)}>{label}</Text>+ </Node>+ </Node>+ ))}+ </Node>+ </AbsoluteFill>+ );+}++registerRoot(() => <Composition id="main" component={Shot} durationInFrames={11} fps={60} width={1280} height={720} />);diff --git a/sdk/raea/bench/bevy-parity/ui/ui_scaling.tsx b/sdk/raea/bench/bevy-parity/ui/ui_scaling.tsxnew file mode 100644index 00000000..7cb6fe39--- /dev/null+++ b/sdk/raea/bench/bevy-parity/ui/ui_scaling.tsx@@ -0,0 +1,26 @@+// Bevy v0.20.0 examples/ui/ui_scaling.rs in raea's TSX: an antique-white box over the middle quarter of the window+// (absolute, a quarter in from the left and top, half as wide and tall; children spaced around, centred), holding a+// 40 px red square with "Size!" in black 13 px text, a blue box 15% of the parent each way, and a 30 px ImageNode of+// branding/icon.png. UiScale eases to its target only when the up or down arrow is pressed, so it holds at 1. Bevy's+// Camera2d over the default clear colour is the layered <Canvas3D>. In Bevy's default 1280 x 720 window.+import { AbsoluteFill, Composition, registerRoot, staticFile } from "raea";+import { Canvas3D } from "raea/3d";+import { ImageNode, Node, Text, percent, px } from "raea/ui";+import { Srgba } from "raea/color";++function Shot() {+ return (+ <AbsoluteFill>+ <Canvas3D layered clearColor="rgb(43, 44, 47)" />+ <Node width={percent(50)} height={percent(50)} position_type="Absolute" left={percent(25)} top={percent(25)} justify_content="SpaceAround" align_items="Center" background_color={new Srgba(250 / 255, 235 / 255, 215 / 255)}>+ <Node width={px(40)} height={px(40)} background_color={new Srgba(1, 0, 0)}>+ <Text font_size={{ Px: 13 }} color={new Srgba(0, 0, 0)}>Size!</Text>+ </Node>+ <Node width={percent(15)} height={percent(15)} background_color={new Srgba(0, 0, 1)} />+ <ImageNode image={staticFile("branding/icon.png")} width={px(30)} height={px(30)} />+ </Node>+ </AbsoluteFill>+ );+}++registerRoot(() => <Composition id="main" component={Shot} durationInFrames={11} fps={60} width={1280} height={720} />);