Skip to content

Keep density edits interactive and match GPU preview to generate() - #58

Draft
jmossymoss wants to merge 3 commits into
mainfrom
cursor/async-edit-gpu-preview-b00c
Draft

Keep density edits interactive and match GPU preview to generate()#58
jmossymoss wants to merge 3 commits into
mainfrom
cursor/async-edit-gpu-preview-b00c

Conversation

@jmossymoss

@jmossymoss jmossymoss commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Problem

Adjusting face segment counts felt modal: rebuilds were slow, a centred progress card covered the viewport, and the cyan GPU overlay often disagreed with the mesh that landed. Editing another face while a bake was in flight hid the preview because the bake queue marked the face HighFidelity as soon as the previous generate() published.

Approach

Scheduling stays AD-1: one worker, latest-wins FIFO, every bake still calls weft::generate() with a frozen snapshot.

  • Pending faces stay Queued across an in-flight publish so the overlay does not vanish before the latest counts land.
  • Incremental bakes report in the corner overlay; the centred hourglass is only for STEP load / first mesh.
  • GPU isolines use the trimmed-face UV box and the same semantic counts generate() reports (faceCounts). Non-lattice meshers no longer draw a fake UV grid.
  • enqueueBake() no longer sets dirty after the snapshot is queued, so settle/screenshot waits do not spin.

Tests

  • bake_queue_tests: latest-wins plus Queued fidelity between jobs
  • gpu_proxy_tests: revolution grid overlay matches faceCounts; UV normalize 0-1 on cylinder / box / bspline slab
  • weft_tests (pipeline): passed
  • Headless app screenshots: settled cylinder mesh vs GPU preview 24x4 on the same drum (96 quads)

Settled cylinder mesh after a 24x4 density override
GPU preview overlay 24x4 on the same cylinder drum

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 3 commits August 21, 2026 15:00
Publishing an in-flight bake was marking the trigger face HighFidelity even
when latest-wins still had a snapshot in the FIFO. That hid the GPU preview
and made the last mesh look final while another generate() was still queued.

Co-authored-by: jmossymoss <jmossymoss@users.noreply.github.com>
…ble.

The cyan overlay now uses trimmed-face UV bounds and the same semantic
counts generate() reports, and it is drawn only for lattice meshers.
Incremental bakes stay in a corner status line so other faces can be
selected and edited while the worker settles.

Co-authored-by: jmossymoss <jmossymoss@users.noreply.github.com>
enqueueBake() was setting dirty=true after snapshotting work, which left
screenshot and settle waits spinning until another frame cleared the flag.
The debounce path still sets dirty before enqueue; the worker snapshot is
the source of truth once the job is in the FIFO.

Co-authored-by: jmossymoss <jmossymoss@users.noreply.github.com>
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.

2 participants