Skip to content

feat(studio): GLSL editor autocomplete — generated builtin manifest + uniforms (M3)#105

Merged
Yona-Appletree merged 1 commit into
mainfrom
feature/glsl-autocomplete
Jul 16, 2026
Merged

feat(studio): GLSL editor autocomplete — generated builtin manifest + uniforms (M3)#105
Yona-Appletree merged 1 commit into
mainfrom
feature/glsl-autocomplete

Conversation

@Yona-Appletree

Copy link
Copy Markdown
Member

M3 of the glsl-editor-ux roadmap. Typing a prefix in the GLSL editor offers completions with real signatures; accepting inserts a snippet with navigable placeholders.

What completes

  • This shader's uniforms — from ShaderDef.consumed, typed exactly as the generated uniform header declares them (time — uniform float)
  • LPFN builtins — full typed signatures + descriptions (float lpfn_fbm(vec2 p, int octaves, uint seed)), one entry per overload
  • Standard GLSL + texture builtins — name+arity snippets (mix(${x}, ${y}, ${a}))
  • vec/mat constructors and the render entry snippet

Never hand-authored (D5)

The manifest is a new generated leaf crate (lps-builtin-completions) emitted by lps-builtins-gen-app. Two compiler sources feed it: the BuiltinId mapping tables, and the new lps_glsl::builtin_inventory — the compiler-inlined set (mix/clamp/dot/…) declared as data beside the compiler and unit-tested against its own builtin_kind/check_builtin_arity. Drift tests tie the manifest to both, so phantom or missing names fail the build. IR/VM internals are deliberately absent. LPFN descriptions live as doc comments on the builtin sources.

Editor side

@codemirror/autocomplete added to the vendored bundle (345.5 → 375.5 KB, +21.7 KB); façade completions option + setCompletions behind a Compartment; completions prop on CodeEditor following the diagnostics interop pattern. Empty list = the extension is absent, so plain/XML editors never grow a popup; existing ⌘↵/⌘S keymaps unaffected.

Validation

  • Filetests byte-identical (28495/28495) — the generator emits data only
  • Regen deterministic; drift + inventory + e2e uniforms tests green; full gate green
  • Live-verified in the sim: lpfn_f → typed fbm overloads, tim → the time uniform, mi → mix/min
  • Story baselines regenerated

Review gate: live completion feel — worth a minute of typing in the sim before merge.

Follow-ups filed separately: GLSL error line-offset fix (naga prologue remap — chip filed), user functions/locals completion (needs compiler symbol info), GLSL-spec typed decoration for std builtins.

Plan: Planning/lp2025/2026-07-15-glsl-autocomplete/

🤖 Generated with Claude Code

… uniforms (M3)

Typing in the GLSL editor now offers completions: this shader's consumed
uniforms (typed exactly as the generated uniform header declares them),
the render entry snippet, vec/mat constructors, and every user-callable
builtin — LPFN with full typed signatures and doc-comment descriptions,
standard GLSL and texture builtins with name+arity snippets. Accepting
inserts a snippet with navigable placeholders.

Completions are generated from the compiler's builtin sources, never
hand-authored (roadmap D5):

- New generated leaf crate lps-builtin-completions (const manifest,
  emitted by lps-builtins-gen-app alongside the existing outputs; LPFN
  descriptions live as doc comments on the builtin sources, seeded once
  from the old web-demo list).
- New lps_glsl::builtin_inventory: the compiler-INLINED builtin set
  (mix/clamp/dot/… — no BuiltinId, invisible to the mapping tables)
  declared as data beside the compiler, unit-tested against
  builtin_kind + check_builtin_arity; the generator consumes it. IR/VM
  internals are deliberately absent from the manifest.
- Drift tests tie the manifest to BuiltinId::all(), the mapping tables,
  and the inventory — phantom or missing names fail the build.
- Vendored CodeMirror bundle gains @codemirror/autocomplete (345.5 →
  375.5 KB); the façade exposes a completions option + setCompletions
  behind a Compartment; CodeEditor gets a completions prop (diagnostics
  interop pattern). Empty list = no popup (plain/XML editors unchanged).
- UiAssetEditor carries the shader's consumed uniforms, populated
  controller-side from the mirrored slot tree; glsl_type_for_lp_type
  exposed from lpc-model as the single type-name source; e2e-tested
  through the in-process server.

Filetests byte-identical; generator regen deterministic; full gate
green; live-verified in the sim (typed prefixes offer fbm overloads,
the time uniform, and mix/min with spec param names).

Plan: Planning/lp2025/2026-07-15-glsl-autocomplete/plan.md

Co-Authored-By: Claude Fable 5 <[email protected]>
@Yona-Appletree
Yona-Appletree merged commit d9180eb into main Jul 16, 2026
3 checks passed
Yona-Appletree added a commit that referenced this pull request Jul 16, 2026
Brings in PR #105 (GLSL editor autocomplete — generated builtin manifest
+ uniforms) and PR #97 (device-link M5: native espflash-lib manage(),
unified cli_connect, fwcheck/calibrate on shared abstractions).

Conflicts: lpa-studio-core lib.rs export list — a pure union (this
branch's binding-authoring types + main's UiShaderUniform); one story
baseline PNG taken from main and re-captured in the follow-up commit.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
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