Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .claude/skills/organizing-buiy-docs/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Implications:

The date is **when the doc was written**, not the implementation target. The `-design.md` suffix on specs is what visually distinguishes specs from plans in `ls` output. Plans omit it. Prior-art files use the system name (no date prefix) because they're living docs — track revision history via git, not filename.

**Exception to the dated-plan rule:** a rolling, intentionally-undated backlog file (`docs/plans/follow-ups.md`) is permitted. It is a living cross-phase tracker, not a one-shot dated migration, so it carries no date prefix — its entries are flipped to `LANDED` in place as work ships rather than being superseded by a new dated plan.

**Existing files predating these rules are not renamed.** The convention applies to new docs only; the master index labels older entries explicitly so the missing suffix does not affect discovery.

## Document headers
Expand Down Expand Up @@ -87,7 +89,7 @@ Use a folder (`docs/specs/YYYY-MM-DD-<topic>/`) only when one logical document i
Rules:

- The parent `README.md` is **required**. It states the folder's purpose and links every child.
- Children use kebab-case topic names with **no date prefix** — they inherit the parent's date.
- Children use kebab-case topic names with **no date prefix** — they inherit the parent's date. *Exception:* a dated **design-note / ADR** child that records its own decision date and status is permitted inside a spec folder (it reads like a miniature dated report scoped to the parent design — e.g. the render-pipeline folder's `2026-06-*` children — where the date marks when that decision was made). These are the only children that may carry a date prefix.
- Children are facets of one design, not phase numbers. Phases imply ordering; children do not.
- Maximum one level deep. If a child needs its own children, promote it to a top-level spec.

Expand Down
6 changes: 6 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ does **not** require a display:

```sh
cargo test -p buiy_core -j 2 -- --ignored --test-threads=1
cargo test -p buiy_verify -j 2 -- --ignored --test-threads=1
```

The GPU lane has **two legs**, both of which CI runs: `buiy_core` (the render
GPU path above) and `buiy_verify` (the visual-bug verification suite — goldens,
reftests, the perceptual metric). Run both before pushing, or you skip the
`buiy_verify` GPU tests and can land a regression that fails CI's GPU lane.

`--test-threads=1` serializes the GPU work (one adapter context at a time). This
lane is **additive** — it must pass on a GPU host, and the headless gate above
must stay green independently (CI has no adapter). When adding a render GPU test,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn on_press(mut presses: MessageReader<OnPress>) {

## Demos

Two runnable example crates live under `examples/`:
Two runnable visual demos (plus the headless `capture` tool) live under `examples/`:

```sh
cargo run -p hello_button # a single clickable "Save" button; logs OnPress to stdout
Expand All @@ -124,7 +124,7 @@ cargo run -p hello_text # a themed title above a wrapped body paragraph

### Requirements

- **Rust:** stable, edition 2024 (MSRV 1.85) — selected automatically via `rust-toolchain.toml`.
- **Rust:** stable, edition 2024. The MSRV (1.85) is enforced by `rust-version` in the workspace manifest; `rust-toolchain.toml` pins the floating `stable` channel and the `rustfmt`/`clippy` components.
- **Bevy:** 0.18.
- **Linux system deps** (Bevy needs these to open a window):

Expand Down
54 changes: 41 additions & 13 deletions docs/README.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/plans/2026-06-03-buiy-render-r1-component-model.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Render component model (R1) Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Depends on:** nothing. **Execution order:** R1 → R2 → R3 → R4 → R5 → R6 → R7 → R8 → (R9, R10) → R11. R1 is the FIRST phase and the **sole creator** of `crates/buiy_core/src/render/components.rs` and `crates/buiy_core/src/render/color.rs`, and the **sole definer** of every shared render type: `Background`, `Border` (+ `BorderSide`, `Radius`, `Corners`, `LineStyle`), `BoxShadow` (+ `Shadow`), `Opacity` (manual `Default 1.0`), `Outline`, `CssVisibility`, `OffscreenAuto`, `ClipRect`, `AncestorClip`, `EffectGroup` (+ `EffectReason`), `Filter` (+ full 10-variant `FilterFn`), `MixBlendMode`, `BackdropFilter`, `Angle`, `ClipRadius`, and `ColorToken` (+ `SystemColorKeyword`, in `render/color.rs`). Every later phase imports these from `render::components` / `render::color` and MUST NOT redefine them, re-`pub mod`, or re-`register_type` them.
Expand Down
3 changes: 3 additions & 0 deletions docs/plans/2026-06-03-buiy-render-r10-atlas.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Texture Atlas Infrastructure + Glyph/Icon Seam Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Build the shared render-world `BuiyAtlas` resource (guillotiere allocation, LRU eviction, page-budget pressure, warmup, pooling) plus the two F-tier atlas-sampling primitive shapes (`GlyphAlphaInstance`, `IconInstance`) and the `get_or_insert`/`AtlasEntry` seam that `buiy-text-rendering-design` plugs into.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Color, Forced-Colors, and the Verification Harness Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Land the render-side color contract — `ColorToken` resolution against `Res<Theme>`, the `Theme::is_changed()` re-extract edge, a main-world forced-colors `Theme` swap with a v1 stub system-color map, the two gate-#11 static analyzers (token-flow + no-shadow-only-affordance), and the scaffolded gate-#2 golden-image harness — all proven headless except the goldens.
Expand Down
3 changes: 3 additions & 0 deletions docs/plans/2026-06-03-buiy-render-r2-clip-rects.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Clip Render-Prep (WriteClipRects) Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Depends on:** R1 (component model — owns `render/components.rs`, the sole home of `ClipRect` / `AncestorClip`). Execution order: R1 → **R2** → R3 → R4 → R5 → R6 → R7 → R8 → (R9, R10) → R11.
Expand Down
3 changes: 3 additions & 0 deletions docs/plans/2026-06-03-buiy-render-r3-transform-bridge.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Transform / GlobalTransform Bridge Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Depends on:** R1 (`render/components.rs` + `render/color.rs` and every shared render type — `Background`, `Border`, `ResolvedTransform` consumers, `ColorToken`). **Execution order:** R1 → R2 → R3 → R4 → R5 → R6 → R7 → R8 → (R9, R10) → R11. R3 imports `Background`/`Border`/`ColorToken` and `resolve_token` from R1's `render::components` / `render::color` / `render::mod`; it MUST NOT define or re-export any of them. R3 introduces NO new `BuiySet` variant (spec [architecture.md § 5.1/§ 5.2](../specs/2026-06-03-buiy-render-pipeline-design/architecture.md) forbids a new top-level render set); `write_buiy_transform` + the three `bevy_transform` propagation systems are pinned directly `.after(BuiySet::Animate).before(BuiySet::Picking)` inside the existing chain.
Expand Down
3 changes: 3 additions & 0 deletions docs/plans/2026-06-03-buiy-render-r4-effect-groups.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Effect-group formation (`WriteEffectGroups`) Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Depends on:** R1 (sole creator of `render/components.rs` + `render/color.rs` and sole definer of `Opacity`/`Filter`/`FilterFn`/`MixBlendMode`/`BackdropFilter`/`EffectGroup`/`EffectReason`). Execution order: R1 → R2 → R3 → **R4** → R5 → R6 → R7 → R8 → (R9, R10) → R11.
Expand Down
3 changes: 3 additions & 0 deletions docs/plans/2026-06-03-buiy-render-r5-extract.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Per-view Extract Rework Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **Depends on:** R1 (component-model — owns `render/components.rs` + `render/color.rs` and all shared render types). Execution order across the render-pipeline series: R1 → R2 → R3 → R4 → **R5** → R6 → R7 → R8 → (R9, R10) → R11. R6 consumes this phase's `ExtractedNodes`.

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
Expand Down
3 changes: 3 additions & 0 deletions docs/plans/2026-06-03-buiy-render-r6-prepare-buffers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Prepare phase: persistent buffers + view uniform + instance packing Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Depends on:** R5 (and R1). Execution order: R1 → R2 → R3 → R4 → R5 → **R6** → R7 → R8 → (R9, R10) → R11. R6 **consumes** R5's per-view `ExtractedNodes` component (owned by R5, `render/extract.rs`) and R1's shared render types (`render/components.rs`); it does **not** redefine them. R6 **owns** the CPU instance bucketing (`render/buckets.rs`) and the shared `BuiyPrimitiveKind` enum that R7 imports.
Expand Down
3 changes: 3 additions & 0 deletions docs/plans/2026-06-03-buiy-render-r7-pipelines-shaders.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Typed-primitive pipelines + SDF shaders Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Depends on:** R6 (`render/buckets.rs` — owns the shared `BuiyPrimitiveKind { Shadow, Quad, Glyph, Path }` enum and CPU instance bucketing; R7 **imports** that enum, it does not redefine it). Execution order: R1 → R2 → R3 → R4 → R5 → R6 → **R7** → R8 → (R9, R10) → R11. R7 must land after R6 so `BuiyPrimitiveKind` exists to import.
Expand Down
5 changes: 5 additions & 0 deletions docs/plans/2026-06-03-buiy-render-r8-paint-clip-toplayer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Paint-order walk + clip scissor + top-layer composite Implementation Plan

**Date:** 2026-06-03
**Status:** superseded (Task 8 superseded by R8b; Tasks 1–7 landed)

> **STATUS (2026-06-06): partially landed + partially superseded.** Executed
> against the landed R5/R6 state, several tasks turned out to be already shipped by
> R5: the forward `painters_z` walk (Task 2 `flatten_paint_order`) duplicates R5's
Expand All @@ -15,6 +18,8 @@
> with R9. See
> [2026-06-06-render-node-draw-model-design.md](../specs/2026-06-03-buiy-render-pipeline-design/2026-06-06-render-node-draw-model-design.md)
> and the follow-ups.md entry. Tasks below are the original plan, kept for context.
> **Task 8 landed via R8b** (per-instance fragment-discard clip); see
> [2026-06-07-buiy-render-r8b-node-draw.md](2026-06-07-buiy-render-r8b-node-draw.md).

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

Expand Down
20 changes: 19 additions & 1 deletion docs/plans/2026-06-03-buiy-render-r9-effect-compositor.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Off-screen Effect-Group Compositor Implementation Plan

**Date:** 2026-06-03
**Status:** landed

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Build the v1 off-screen effect-group compositor — pure-CPU prepare-phase geometry (painted-bounds transitive union, next-pow2-capped-at-view bucketing, post-order indexing, `rt_pool_budget` degradation decision) gating green headless, plus the GPU prepare system, pooled `Rgba16Float` targets, and bottom-up composite passes (group `Opacity` linear + `isolation`) wired into `BuiyNode::run` behind the `#[ignore]` GPU path.
Expand All @@ -10,6 +13,19 @@

**Tier/Test reality:** Split. The prepare-phase geometry and budget logic are **pure functions** in `render::compositor` — HEADLESS (unit tests on CI, no wgpu adapter). Everything that needs a wgpu adapter — the `RenderSystems::Prepare` system constructed in the `RenderApp`, the pooled-target acquisition, the actual composite draws, the group-opacity golden, and the RSS-leak fixture — is **GPU (code + `#[ignore]`)**, mirroring `tests/render_smoke.rs` (no wgpu adapter on CI or this host).

> **As-landed (2026-06-07):** the GPU orchestration this plan scaffolded — the
> `prepare_effect_groups` body, the extract→prepare effect-group dataflow
> (`EffectGroupExtract` + per-group buffer partition), the pooled `Rgba16Float`
> targets, and the bottom-up `BuiyNode::run` composite passes — was **built and
> verified on real hardware** in the
> [render GPU-verification campaign](2026-06-07-render-gpu-verify-campaign.md)
> (Phase 4 item 5; the overlap-composites-once-at-0.5 and RT-pool-returns-to-baseline
> tests are green on the GPU lane). The `#[ignore]` markers below stay — they gate
> the wgpu-adapter tests off the headless CI gate, which still runs without an
> adapter — but `prepare_effect_groups` and the composite passes are live code, not
> inert stubs. Design note:
> [2026-06-08-render-effect-compositor-gpu-design.md](../specs/2026-06-03-buiy-render-pipeline-design/2026-06-08-render-effect-compositor-gpu-design.md).

---

## Cross-phase dependencies (assumed, not built here)
Expand Down Expand Up @@ -1155,4 +1171,6 @@ Steps:

## Cross-phase dependency assumed

The prepare-system **body** (Task 9) and the node **subtree-render** (Task 10) consume types/inputs owned by sibling phases not landed here: `Opacity`/`BoxShadow`/`Outline`/`EffectGroup` (component-model phase), `WriteEffectGroups` (render-prep phase), `ClipRect`/`AncestorClip` (clip-and-transform phase), and the per-view `ExtractedNodes`/extract-of-group-members (architecture phase). To keep the gate green without them, this phase's pure core is written against plain geometry inputs and the component-reading glue rides the `#[ignore]` GPU path — an un-landed upstream phase cannot redden CI. `EffectReason` is defined locally here (Task 1) and unifies with component-model's `EffectGroup` when that lands.
The prepare-system **body** (Task 9) and the node **subtree-render** (Task 10) consume types/inputs owned by sibling phases not yet landed *at plan time*: `Opacity`/`BoxShadow`/`Outline`/`EffectGroup` (component-model phase), `WriteEffectGroups` (render-prep phase), `ClipRect`/`AncestorClip` (clip-and-transform phase), and the per-view `ExtractedNodes`/extract-of-group-members (architecture phase). To keep the gate green without them, this phase's pure core is written against plain geometry inputs and the component-reading glue rides the `#[ignore]` GPU path — an un-landed upstream phase cannot redden CI. `EffectReason` is defined locally here (Task 1) and unifies with component-model's `EffectGroup` when that lands.

> **As-landed:** all of those sibling phases (R1 component-model, R4 `WriteEffectGroups`, R2 clip-and-transform, R5 extract) shipped, and the prepare-system body + node composite passes were filled in and verified on real hardware in the [render GPU-verification campaign](2026-06-07-render-gpu-verify-campaign.md). The local `EffectReason` unified onto the component-model `EffectGroup` as planned.
2 changes: 1 addition & 1 deletion docs/plans/2026-06-07-buiy-render-r8b-node-draw.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# R8b: Hybrid Node-Draw Model Implementation Plan

**Date:** 2026-06-07
**Status:** active
**Status:** landed
**Spec:** [specs/2026-06-03-buiy-render-pipeline-design/2026-06-06-render-node-draw-model-design.md](../specs/2026-06-03-buiy-render-pipeline-design/2026-06-06-render-node-draw-model-design.md) (DECIDED: Option C hybrid)
**Supersedes:** [plans/2026-06-03-buiy-render-r8-paint-clip-toplayer.md](2026-06-03-buiy-render-r8-paint-clip-toplayer.md) Task 8 only. Tasks 1–7 of that plan (`scissor_rect`, `clip_for_primitive` in `render/clip.rs`; `partition_top_layer` in `render/top_layer.rs`) are landed and consumed here without re-implementation.

Expand Down
10 changes: 10 additions & 0 deletions docs/plans/2026-06-07-render-gpu-verify-campaign.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Render GPU-Verification Campaign

**Date:** 2026-06-07
**Status:** landed
**Spec:** [2026-06-03-buiy-render-pipeline-design](../specs/2026-06-03-buiy-render-pipeline-design/README.md)
**Realizes the render design notes:**
[2026-06-07-render-extract-retain-damage-design.md](../specs/2026-06-03-buiy-render-pipeline-design/2026-06-07-render-extract-retain-damage-design.md)
(damage-retention re-extract), [2026-06-08-render-atlas-glyph-gpu-design.md](../specs/2026-06-03-buiy-render-pipeline-design/2026-06-08-render-atlas-glyph-gpu-design.md)
(coverage-glyph atlas GPU pipeline), and [2026-06-08-render-effect-compositor-gpu-design.md](../specs/2026-06-03-buiy-render-pipeline-design/2026-06-08-render-effect-compositor-gpu-design.md)
(effect-group GPU orchestration); the [2026-06-06-render-node-draw-model-design.md](../specs/2026-06-03-buiy-render-pipeline-design/2026-06-06-render-node-draw-model-design.md)
spine landed via [2026-06-07-buiy-render-r8b-node-draw.md](2026-06-07-buiy-render-r8b-node-draw.md).

> **For agentic workers:** this is a *campaign* plan, not a bite-sized TDD plan.
> The bug-fix work is exploratory — the exact bugs are discovered by running the
> GPU suite, then each fix is driven TDD-style as it surfaces. Phases are run as
Expand Down
4 changes: 2 additions & 2 deletions docs/plans/2026-06-11-buiy-text-t9-verification-closure.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Buiy Text T9: Verification Closure + Docs Flip — Implementation Plan

**Date:** 2026-06-11
**Status:** proposed
**Status:** landed
**Spec:** [specs/2026-06-09-buiy-text-rendering-design/verification.md](../specs/2026-06-09-buiy-text-rendering-design/verification.md) §§ 1.3, 3.3, 4, 5 + [architecture.md](../specs/2026-06-09-buiy-text-rendering-design/architecture.md) § 2.3 + [README.md](../specs/2026-06-09-buiy-text-rendering-design/README.md) (Status block + Open-questions ledger)
**Campaign:** [plans/2026-06-09-buiy-text-campaign.md](2026-06-09-buiy-text-campaign.md) — phase T9, the FINAL phase (depends on all of T1–T8; the implementer starts from a branch with T1–T8 merged — T8 landed @ `12cb830`)
**Closes:** the text campaign. After this plan the campaign's phase table is all-landed, the spec Status flips from proposed, and the prior-art folders carry their owed correction pass.
Expand Down Expand Up @@ -734,7 +734,7 @@ line in Orientation § 7, per D6 (correction blockquotes, no rewrites).
Attrs lifetimes)"); key-facts table swash row → 0.2.8-as-locked
annotation; add one dated line: "2026-06-11 — correction pass (text
campaign T9): 0.19-verified errata applied per
[text verification.md § 5]()".
[text verification.md § 5](../specs/2026-06-09-buiy-text-rendering-design/verification.md)".
- [ ] `grep -rn "set_text(" docs/prior-art/cosmic-text/ docs/prior-art/bevy-cosmic-edit/`
— annotate every sketch passing a font system (the lazy-setter 0.19
signature: `set_text(&mut self, text, attrs: &Attrs, shaping,
Expand Down
2 changes: 1 addition & 1 deletion docs/plans/2026-06-13-buiy-text-editing-e1-substrate.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Buiy text-editing E1 — Editor substrate + Buffer ownership

**Date:** 2026-06-13
**Status:** ready to execute
**Status:** landed
**Campaign:** [2026-06-13-buiy-text-editing-campaign.md](2026-06-13-buiy-text-editing-campaign.md) § "E1 — Editor substrate + Buffer ownership"
**Spec:** [editing-and-ime.md](../specs/2026-06-09-buiy-text-rendering-design/editing-and-ime.md) §§ 2.1, 2.2, 2.2a, 2.3; [measure-and-layout.md](../specs/2026-06-09-buiy-text-rendering-design/measure-and-layout.md) § 2.3

Expand Down
Loading
Loading