Skip to content

Phase 4: multi-region & cross-file joint denoise - #4

Merged
atatess merged 19 commits into
mainfrom
phase4-multiregion
Jul 6, 2026
Merged

atatess merged 19 commits into
mainfrom
phase4-multiregion

Conversation

@atatess

@atatess atatess commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Generalizes the single-region diffusion editor to edit multiple regions at once — jointly denoised in one sequence, steered by type-checker feedback that spans regions and files.

What's new

Sampler — a multi-region infill loop. build_multi_infill_mask applies the single-region gen→suffix relaxation per region (conservative attend_future_regions=False default, chosen by a real-model spike); multi_infill denoises R masked spans in one sequence, and repair widens-to-tail per region without disturbing the fixed text between them. Single-region denoise/infill are the R=1 special case, preserved byte-identical.

Type feedback across regions. pyright runs on the full reconstruction; each diagnostic's char range maps to (region, absolute position) — with an explicit reconstruction-index → absolute-position map, since a region that over-fills shifts every later region left — and repair re-masks per region.

Cross-file. Each file denoises its own sequence, but a global driver reconstructs all files into one pyright workspace so imports resolve, then dispatches re-masks back per (file, region). A call-site error in file B caused by file A's regenerated signature is attributed across the import and re-denoised.

Product surface. Engine.edit_regions / edit_files, RPC editRegions / editFiles (each with a distinct */step streaming notification), and a VS Code "Regenerate Regions" multi-selection command.

Acceptance evals (real 4-bit model)

  • Multi-region (eval/results_multiregion.md): across two-region cross-dependency cases, type-aware denoise cut errors 11 → 5, 3/6 fully fixed. Ablation: joint visibility without the checker scored 16 (worse than independent) — the type feedback carries the gain, not mere visibility.
  • Cross-file (eval/results_crossfile.md): per-file feedback 3 → cross-file workspace feedback 1. The fixed case is a float-index error in main.py that a single-file check can't see (the import doesn't resolve alone) but the shared workspace catches.

Tests

197 pytest (injected fake forward + fixtures, no model needed) + 51 vitest + tsc, all green. Every loop change is TDD'd before the real-model path; single-region behavior is unchanged.

Not included

The cross-file extension accumulator UI (per-file version guards, offset invalidation, N-file preview) is deferred — it is materially more than a protocol seam. The cross-file engine, RPC, and eval are complete.

atatess added 19 commits July 6, 2026 10:28
@atatess
atatess merged commit 66f7f0a into main Jul 6, 2026
2 checks passed
@atatess
atatess deleted the phase4-multiregion branch July 6, 2026 09:17
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