Skip to content

render: keep text input values and cursors within their fields - #4875

Merged
jakildev merged 1 commit into
codex/editor-workarea-focusfrom
codex/editor-text-input-viewport
Nov 5, 2026
Merged

jakildev merged 1 commit into
codex/editor-workarea-focusfrom
codex/editor-text-input-viewport

Conversation

@jakildev

@jakildev jakildev commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Keep long single-line widget values inside their fields while preserving the complete editable value. A shared viewport calculation follows the insertion point, and the renderer places the cursor relative to the displayed substring. Layout auditing uses the same text calculation.

Validation

  • Built IrredenEngineTest on macOS.
  • Focused GUI layout, keyboard, and motion-preview suite: 52/52 tests passed, including two new viewport cases for cursor beginning/middle/end, invalid positions, empty/short/narrow fields, glyph and cursor containment, and unchanged complete values.
  • Header checks passed (788 headers); formatting, whitespace, comment-reference and instruction-size checks passed without introduced violations.
  • Built IRVoxelEditor and ran the combined-stack motion_preview GUI workflow: 11/11 assertions, 11 captures, zero layout findings, clean exit. The prior run reported component-value text overflowing the field; the rerun keeps it inside while authored component records remain intact.

Scope

This fixes the component-overrides field exposed by the editor workflow and applies to shared text-input widgets. Existing click-to-focus and keyboard Home/End/Left/Right behavior remains; it does not add selection, clipboard editing, or a native text control.

The viewport is computed from the existing insertion position; no stored scroll state or serialized component changes are introduced. Long unfocused values can show their suffix when the insertion point is at the end. Home/End and arrow keys reveal the rest.

Screenshots

Same neutral combined-stack fixture after returning from preview, native macOS/Metal at 3200×1800, yaw 0, zoom 4, subdivisions 4. The paired pixel difference is confined to the component-value row (1034,938)–(2054,960); the remainder is identical. These are combined-stack captures, not isolated builds of this PR. PNGs are used because this editor has no auto-record wiring.

Before After

Reviewed-foundation integration

The stack incorporates foundation amendment a93a6d6 (hidden-widget hitboxes and visibility persistence) without rewriting published commits. IRVoxelEditor rebuilt at combined-stack head 598b23b. All five follow-up workflows passed: 63/63 assertions across 51 captures, zero layout findings, and five clean exits. The host reported zero monitors during this additional offscreen Metal pass; the longer document and motion runs used the documented 30-second display-discovery grace while retaining the run watchdog, GPU lease, assertions and layout checks. Earlier display-guard terminations are not counted as passes. The earlier unit runs and screenshots remain scoped as described above.

@jakildev jakildev added fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend labels Nov 2, 2026
@jakildev
jakildev added this pull request to stack #4870 November 2, 2026 07:37
@jakildev jakildev added the fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved label Nov 2, 2026
@jakildev

jakildev commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Holding review: upstream PR #4873 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Perf gate

Head host slug: linux-x86_64-epyc-7763-64-unknown

perf comparison: 9557153 → 5c0d419-ci

baseline: /home/runner/work/_temp/perf-baseline/history/linux-x86_64-epyc-7763-64-unknown/95571531742c09e1f18da3db0d1830b085f8c5f5
head: /home/runner/work/IrredenEngine/IrredenEngine/save_files/perf/5c0d41937-ci

host calibration

  • host: linux-x86_64-epyc-7763-64-unknown (matches baseline)
  • ref_ms: head 103.70 vs baseline 103.55 (load_factor 1.00×)
  • calibration target: 50.00 ms (informational)
  • baseline capture: perf-baseline@955715317 (branch tip); master 4d4a9c114, finished 2026-11-01T01:37:19Z, 1.3 d before the head run, ref_ms 103.55
  • weighting: raw (class-matched capture; load_factor 1.00×; no calibration-scaling entry)
  • attribution: improvement withheld, stacked: merge base 44bb103fe is not on refs/remotes/origin/master, so the run measured the base branch's unmerged changes

thresholds: regress ≥ 10%, improve ≥ 5%

voxel cull effectiveness

cell ratio (base→head) avg visible total avg feeder
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.788 → 0.788 (+0.0pp) 156630 → 156630 262144 → 262144 50080 → 50080 (1.000×)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.990 → 0.990 (+0.0pp) 255592 → 255592 262144 → 262144 3862 → 3862 (1.000×)

frame timing (ms)

cell avg p99
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 482.68 → 492.35 (+2.0%) 1912.86 → 1727.49 (-9.7%) ↓
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 1284.12 → 1275.11 (-0.7%) 2574.71 → 2570.40 (-0.2%)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 672.58 → 654.52 (-2.7%) 12714.36 → 12295.69 (-3.3%)
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 1743.19 → 1727.53 (-0.9%) 3027.44 → 3037.49 (+0.3%)

GPU frame timing (ms; separate from stage samples)

cell envelope (base→head) buffer spans (base→head) coverage (base→head)
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable

GPU stage timing (avg ms per sampled invocation)

cell canvasClear voxelCompact voxelStage1 voxelCardinalElect voxelStage2 voxelSunFaces textToTrixel buildLightOcclusionGrid computeVoxelAO bakeSunShadowMap computeSunShadow computeLightVolume lightingToTrixel fogToTrixel trixelToFb resolvePerAxisScreenDepth fbToScreen
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 64.31→67.54 63.78→66.78 56.47→58.95 1.30→0.95 ↓ 52.89→54.65 5.40→5.55 — 0.00→0.00 2.58→2.80 14.84→15.34 11.85→11.73 21.74→22.72 3.82→3.66 1.24→1.29 0.21→0.19 ↓ — 8.02→7.90
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 107.96→109.24 417.24→416.71 261.53→261.59 8.04→4.07 ↓ 230.10→232.60 5.13→5.07 — 0.00→0.00 2.40→2.38 28.15→27.63 10.50→10.32 19.57→19.75 8.10→8.04 1.50→1.43 0.20→0.17 ↓ — 7.58→7.30
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 59.42→59.54 81.88→81.26 66.57→65.99 13.08→12.96 48.44→48.02 8.60→8.67 1.15→1.09 0.00→0.00 0.95→0.91 65.19→62.34 10.78→10.50 58.75→56.98 8.20→8.07 1.83→1.80 0.19→0.17 ↓ 0.00→0.00 9.25→9.12
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 120.52→119.80 537.53→534.58 425.81→425.68 6.37→6.32 368.45→366.48 5.43→5.58 1.12→1.07 0.00→0.00 0.72→0.66 ↓ 25.53→24.54 10.72→10.21 19.26→19.09 6.60→6.45 1.49→1.38 ↓ 0.18→0.18 0.00→0.00 7.68→7.38

top CPU systems by avg ms (head)

target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 246.854 → 256.667 (+4.0%)
RENDER ComputeLightVolume 33.089 → 33.986 (+2.7%)
RENDER CanvasToFramebuffer 17.303 → 17.112 (-1.1%)
RENDER BakeSunShadowMap 9.493 → 10.353 (+9.1%)
RENDER ComputeSunShadow 7.826 → 7.693 (-1.7%)
UPDATE PropagateTransform 4.444 → 5.101 (+14.8%) ⚠
UPDATE FogRevealEval 4.251 → 4.227 (-0.6%)
RENDER ComputeVoxelAO 3.994 → 3.906 (-2.2%)

target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1029.388 → 1026.794 (-0.3%)
RENDER ComputeLightVolume 29.437 → 29.616 (+0.6%)
RENDER ComputeSunShadow 21.807 → 21.386 (-1.9%)
RENDER CanvasToFramebuffer 16.427 → 15.955 (-2.9%)
RENDER ComputeVoxelAO 9.553 → 9.501 (-0.5%)
RENDER BakeSunShadowMap 8.723 → 8.569 (-1.8%)
RENDER LightingToTrixel 8.431 → 8.232 (-2.4%)
UPDATE PropagateTransform 4.525 → 4.642 (+2.6%)

target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 291.808 → 289.361 (-0.8%)
RENDER ComputeSunShadow 57.890 → 55.146 (-4.7%)
RENDER LightingToTrixel 37.677 → 35.811 (-5.0%)
RENDER ComputeLightVolume 32.943 → 32.782 (-0.5%)
RENDER BakeSunShadowMap 23.010 → 22.632 (-1.6%)
RENDER CanvasToFramebuffer 17.714 → 17.431 (-1.6%)
RENDER FogToTrixel 7.272 → 7.142 (-1.8%)
UPDATE PropagateTransform 6.270 → 6.124 (-2.3%)

target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1463.424 → 1457.780 (-0.4%)
RENDER ComputeLightVolume 29.476 → 28.862 (-2.1%)
RENDER ComputeSunShadow 19.108 → 18.210 (-4.7%)
RENDER CanvasToFramebuffer 16.257 → 16.258 (+0.0%)
RENDER BakeSunShadowMap 8.716 → 8.658 (-0.7%)
RENDER ComputeVoxelAO 7.771 → 7.712 (-0.8%)
RENDER LightingToTrixel 6.805 → 6.618 (-2.7%)
UPDATE PropagateTransform 6.350 → 6.192 (-2.5%)

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Perf gate

Head host slug: linux-x86_64-xeon-platinum-8573c-unknown

perf comparison: a990fd6 → 44922b2-ci

baseline: /home/runner/work/_temp/perf-baseline/history/linux-x86_64-xeon-platinum-8573c-unknown/a990fd60f603e872fc1f7886ba7fa10ac223d6fb
head: /home/runner/work/IrredenEngine/IrredenEngine/save_files/perf/44922b2b7-ci

host calibration

  • host: linux-x86_64-xeon-platinum-8573c-unknown (matches baseline)
  • ref_ms: head 79.05 vs baseline 77.66 (load_factor 1.02×)
  • calibration target: 50.00 ms (informational)
  • baseline capture: perf-baseline@a990fd60f (branch tip); master 8e5df7839, finished 2026-10-25T01:27:15Z, 8.3 d before the head run, ref_ms 77.66
  • weighting: raw (class-matched capture; load_factor 1.02× < 1.10×)
  • attribution: improvement withheld, stacked: merge base 8972489d7 is not on refs/remotes/origin/master, so the run measured the base branch's unmerged changes

thresholds: regress ≥ 10%, improve ≥ 5%

voxel cull effectiveness

cell ratio (base→head) avg visible total avg feeder
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.990 → 0.990 (+0.0pp) 255592 → 255592 262144 → 262144 3862 → 3862 (1.000×)

frame timing (ms)

cell avg p99
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 480.24 → 515.97 (+7.4%) 6741.47 → 7202.09 (+6.8%)
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 1415.27 → 1441.94 (+1.9%) 2257.77 → 2269.27 (+0.5%)

GPU frame timing (ms; separate from stage samples)

cell envelope (base→head) buffer spans (base→head) coverage (base→head)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable

GPU stage timing (avg ms per sampled invocation)

cell canvasClear voxelCompact voxelStage1 voxelCardinalElect voxelStage2 voxelSunFaces textToTrixel buildLightOcclusionGrid computeVoxelAO bakeSunShadowMap computeSunShadow computeLightVolume lightingToTrixel fogToTrixel trixelToFb resolvePerAxisScreenDepth fbToScreen
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 58.30→59.89 64.15→65.05 50.06→50.85 7.00→7.13 42.52→43.24 7.32→7.54 1.35→1.40 0.00→0.00 0.73→0.78 31.77→38.37 ⚠ 15.88→16.09 31.35→32.86 5.15→5.31 1.52→1.57 0.17→0.19 ⚠ 0.00→0.00 7.75→7.89
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 127.06→129.82 444.89→442.51 323.39→324.15 5.42→5.44 309.87→312.35 5.89→5.73 1.32→1.38 0.00→0.00 0.57→0.60 9.85→18.16 ⚠ 14.11→14.54 11.74→11.96 4.36→4.57 1.19→1.24 0.17→0.17 0.00→0.00 6.43→6.64

top CPU systems by avg ms (head)

target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 240.443 → 246.132 (+2.4%)
RENDER ComputeSunShadow 31.232 → 32.703 (+4.7%)
RENDER ComputeLightVolume 29.633 → 30.160 (+1.8%)
RENDER LightingToTrixel 18.523 → 19.711 (+6.4%)
RENDER CanvasToFramebuffer 15.822 → 16.152 (+2.1%)
RENDER BakeSunShadowMap 1.167 → 9.806 (+740.3%) ⚠
UPDATE PropagateTransform 4.949 → 4.983 (+0.7%)
RENDER FogToTrixel 4.669 → 4.802 (+2.8%)

target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1218.093 → 1221.796 (+0.3%)
RENDER ComputeLightVolume 25.504 → 26.134 (+2.5%)
RENDER CanvasToFramebuffer 14.310 → 14.616 (+2.1%)
RENDER ComputeSunShadow 9.793 → 13.401 (+36.8%) ⚠
RENDER BakeSunShadowMap 0.198 → 6.158 (+3010.1%) ⚠
RENDER ComputeVoxelAO 5.222 → 5.375 (+2.9%)
UPDATE PropagateTransform 4.911 → 5.013 (+2.1%)
RENDER LightingToTrixel 4.476 → 4.691 (+4.8%)

unmatched cells

only in head: target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1, target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Perf gate

Head host slug: linux-x86_64-epyc-7763-64-unknown

perf comparison: 9557153 → 44922b2-ci

baseline: /home/runner/work/_temp/perf-baseline/history/linux-x86_64-epyc-7763-64-unknown/95571531742c09e1f18da3db0d1830b085f8c5f5
head: /home/runner/work/IrredenEngine/IrredenEngine/save_files/perf/44922b2b7-ci

host calibration

  • host: linux-x86_64-epyc-7763-64-unknown (matches baseline)
  • ref_ms: head 104.22 vs baseline 103.55 (load_factor 1.01×)
  • calibration target: 50.00 ms (informational)
  • baseline capture: perf-baseline@955715317 (branch tip); master 4d4a9c114, finished 2026-11-01T01:37:19Z, 1.3 d before the head run, ref_ms 103.55
  • weighting: raw (class-matched capture; load_factor 1.01×; no calibration-scaling entry)
  • attribution: improvement withheld, stacked: merge base 8972489d7 is not on refs/remotes/origin/master, so the run measured the base branch's unmerged changes

thresholds: regress ≥ 10%, improve ≥ 5%

voxel cull effectiveness

cell ratio (base→head) avg visible total avg feeder
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.788 → 0.788 (+0.0pp) 156630 → 156630 262144 → 262144 50080 → 50080 (1.000×)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.990 → 0.990 (+0.0pp) 255592 → 255592 262144 → 262144 3862 → 3862 (1.000×)

frame timing (ms)

cell avg p99
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 482.68 → 496.31 (+2.8%) 1912.86 → 1749.67 (-8.5%) ↓
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 1284.12 → 1280.99 (-0.2%) 2574.71 → 2596.50 (+0.8%)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 672.58 → 660.14 (-1.8%) 12714.36 → 12636.77 (-0.6%)
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 1743.19 → 1732.44 (-0.6%) 3027.44 → 2989.60 (-1.2%)

GPU frame timing (ms; separate from stage samples)

cell envelope (base→head) buffer spans (base→head) coverage (base→head)
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable

GPU stage timing (avg ms per sampled invocation)

cell canvasClear voxelCompact voxelStage1 voxelCardinalElect voxelStage2 voxelSunFaces textToTrixel buildLightOcclusionGrid computeVoxelAO bakeSunShadowMap computeSunShadow computeLightVolume lightingToTrixel fogToTrixel trixelToFb resolvePerAxisScreenDepth fbToScreen
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 64.31→66.77 63.78→66.79 56.47→58.74 1.30→0.97 ↓ 52.89→55.07 5.40→5.70 — 0.00→0.00 2.58→2.80 14.84→15.63 11.85→12.27 21.74→23.27 3.82→3.83 1.24→1.30 0.21→0.19 ↓ — 8.02→8.03
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 107.96→109.29 417.24→417.61 261.53→263.34 8.04→4.04 ↓ 230.10→233.17 5.13→5.08 — 0.00→0.00 2.40→2.37 28.15→28.33 10.50→10.46 19.57→19.58 8.10→8.09 1.50→1.66 ⚠ 0.20→0.18 ↓ — 7.58→7.50
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 59.42→59.43 81.88→83.03 66.57→66.65 13.08→13.79 48.44→48.13 8.60→8.84 1.15→1.11 0.00→0.00 0.95→1.04 65.19→63.83 10.78→10.69 58.75→56.74 8.20→8.15 1.83→1.84 0.19→0.18 ↓ 0.00→0.00 9.25→9.15
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 120.52→119.85 537.53→535.39 425.81→425.56 6.37→6.31 368.45→368.09 5.43→5.64 1.12→1.11 0.00→0.00 0.72→0.76 25.53→24.64 10.72→10.33 19.26→18.85 6.60→6.68 1.49→1.59 0.18→0.19 0.00→0.00 7.68→7.53

top CPU systems by avg ms (head)

target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 246.854 → 256.241 (+3.8%)
RENDER ComputeLightVolume 33.089 → 35.029 (+5.9%)
RENDER CanvasToFramebuffer 17.303 → 17.251 (-0.3%)
RENDER BakeSunShadowMap 9.493 → 10.434 (+9.9%)
RENDER ComputeSunShadow 7.826 → 7.864 (+0.5%)
UPDATE PropagateTransform 4.444 → 5.090 (+14.5%) ⚠
UPDATE FogRevealEval 4.251 → 4.250 (-0.0%)
RENDER ComputeVoxelAO 3.994 → 4.037 (+1.1%)

target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1029.388 → 1030.023 (+0.1%)
RENDER ComputeLightVolume 29.437 → 29.537 (+0.3%)
RENDER ComputeSunShadow 21.807 → 21.825 (+0.1%)
RENDER CanvasToFramebuffer 16.427 → 16.221 (-1.3%)
RENDER ComputeVoxelAO 9.553 → 9.481 (-0.8%)
RENDER BakeSunShadowMap 8.723 → 8.825 (+1.2%)
RENDER LightingToTrixel 8.431 → 8.301 (-1.5%)
UPDATE PropagateTransform 4.525 → 4.621 (+2.1%)

target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 291.808 → 293.638 (+0.6%)
RENDER ComputeSunShadow 57.890 → 56.509 (-2.4%)
RENDER LightingToTrixel 37.677 → 35.954 (-4.6%)
RENDER ComputeLightVolume 32.943 → 32.539 (-1.2%)
RENDER BakeSunShadowMap 23.010 → 23.423 (+1.8%)
RENDER CanvasToFramebuffer 17.714 → 17.545 (-1.0%)
RENDER FogToTrixel 7.272 → 7.292 (+0.3%)
UPDATE PropagateTransform 6.270 → 6.094 (-2.8%)

target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1463.424 → 1460.135 (-0.2%)
RENDER ComputeLightVolume 29.476 → 28.720 (-2.6%)
RENDER ComputeSunShadow 19.108 → 18.265 (-4.4%)
RENDER CanvasToFramebuffer 16.257 → 16.410 (+0.9%)
RENDER BakeSunShadowMap 8.716 → 8.704 (-0.1%)
RENDER ComputeVoxelAO 7.771 → 7.854 (+1.1%)
RENDER LightingToTrixel 6.805 → 6.859 (+0.8%)
UPDATE PropagateTransform 6.350 → 6.142 (-3.3%)

@jakildev jakildev removed the fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved label Nov 2, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — render: keep text input values and cursors within their fields

Verdict: approve

Stacked on #4873 (now fleet:approved; the fleet:awaiting-upstream-review gate is cleared). Reviewing the child diff only — the upstream is approved separately. Head aac17f007, mergeable: MERGEABLE, CLEAN.

Big picture. Text-input values longer than the field now render through a window that follows the insertion point, the cursor is placed relative to that window, and the stored text_ / cursorPos_ are never touched. This is the fix the PR describes for the component-overrides field. The approach is sound: one pure function (textInputViewport) is the single copy of the placement formula, and the renderer (system_widget_render_text_input.hpp) and the layout audit (gui_layout_audit.hpp:289 via textInputText) both read it. That keeps the audit measuring what the renderer draws, as widget_text_layout.hpp's header comment requires. No scroll state and no serialized field is added, so kSaveVersion is not in play.

Checked by hand (widget_text_layout.hpp:227-262):

  • inset <= width/2, so innerWidth >= 0. cursorWidth <= innerWidth, so capacity >= 0. The substr(first, capacity) start is <= length in every branch, so it can't throw out_of_range, including the capacity == 0 case.
  • cursor - first <= capacity in all three clamp branches (lower clamp, centered, upper clamp). The cursor's right edge is at most inset + innerWidth, so it stays inside the field, and the last glyph's right edge is inside it too.
  • For normal widths inset == padding*2, so the unfocused and short-value layout is identical to before. The old hard-coded cursorX = min(...) clamp is replaced by containment by construction.
  • No other reader of cursorPos_ assumes the window starts at character 0. Click handling doesn't map x to a cursor position, so the scrolled window can't desync a click. Keyboard handling in system_widget_apply_text_input.hpp works on the value, not on screen columns.
  • TextRun::text_ is a string_view into the component's text_. That lifetime contract is unchanged ("caller owns it as long as the run is queued"), and the view is queued the same frame it is built.

CI. Every check on the head completed green: linux-build, format-check, header-checks, comment-refs, whitespace, instruction-size, closes-lint, no-plan-files, perf-gate, gate, changes. fleet-tests and swap-approval-label are SKIPPED, with no run on this head. The perf-gate comments flag BakeSunShadowMap / ComputeSunShadow on the xeon host. That is not this PR: the diff touches no sun or shadow code, and the gate says its baseline is the stacked base branch's unmerged changes. Inherited / unrelated.

Tests. The two new GuiLayoutAudit cases cover:

  • cursor at the end, middle and start, plus negative and over-length cursors;
  • empty, short, and 0/1/10/18-px-wide fields;
  • containment of both glyphs and cursor;
  • value preservation.

I recomputed the expected values: inset 8, inner width 34, capacity 4, cursor x = 18 + 4·8 = 50 at the end. They match. The tests exercise the real renderer's placement function, so I have no gap to raise.

Nits (follow-up)

  • widget_text_layout.hpp:236 — Reserving cursor width while unfocused is deliberate and documented. It differs from numberFieldText, which reserves only while editing_ (line 195). A one-line note on why the text input diverges would help the next reader.
  • Behavior question for the next UI pass, not blocking: an unfocused long value now shows its suffix, because cursorPos_ sits at the end after setTextInputValue. For path/name-like fields the head may read better when unfocused. The PR body discloses this, and Home brings the head back.

Praise

  • Folding the cursor placement into the same function as the text window makes drift between the glyphs and the cursor impossible, and the zero/narrow-width degeneracies are handled by clamps rather than special cases.

Test plan the author should run before merge

  • Nothing further — the PR body's evidence (52/52 GUI suites, 11/11 motion_preview assertions, zero layout findings, clean exits) matches the diff.

Escalation: none. Safe for merge.

🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)

Opus recheck not required.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation and removed fleet:reviewing-mac-pool-1 labels Nov 2, 2026
Display a cursor-following substring without changing the complete value. Share the calculation with layout auditing and retain keyboard editing behavior. Cover cursor positions, small fields, glyph containment and value preservation.
@jakildev
jakildev force-pushed the codex/editor-text-input-viewport branch from aac17f0 to f3950b5 Compare November 4, 2026 05:54
@github-actions github-actions Bot added human:re-review Human pushed changes to an approved PR — fleet should re-review and removed fleet:approved Fleet reviewer approved — ready for human merge labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

New commits pushed after fleet approval. Re-tagging human:re-review so the fleet picks it up again.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Perf gate

Head host slug: linux-x86_64-epyc-9v74-80-unknown

perf comparison: bb78d69 → 188b5ff-ci

baseline: /home/runner/work/_temp/perf-baseline/history/linux-x86_64-epyc-9v74-80-unknown/bb78d69e2a267618fec4ee6c5007109ab9afff5e
head: /home/runner/work/IrredenEngine/IrredenEngine/save_files/perf/188b5ff55-ci

host calibration

  • host: linux-x86_64-epyc-9v74-80-unknown (matches baseline)
  • ref_ms: head 116.02 vs baseline 116.24 (load_factor 1.00×)
  • calibration target: 50.00 ms (informational)
  • baseline capture: perf-baseline@bb78d69e2 (class-matched history capture, not the branch tip); master 468c8e57f, finished 2026-10-28T02:06:43Z, 7.2 d before the head run, ref_ms 116.24
  • weighting: raw (class-matched capture; load_factor 1.00×; no calibration-scaling entry)
  • attribution: improvement withheld, stacked: merge base 96bb621f3 is not on refs/remotes/origin/master, so the run measured the base branch's unmerged changes

thresholds: regress ≥ 10%, improve ≥ 5%

voxel cull effectiveness

cell ratio (base→head) avg visible total avg feeder
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.788 → 0.788 (+0.0pp) 156630 → 156630 262144 → 262144 50080 → 50080 (1.000×)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 1.000 → 1.000 (+0.0pp) 262144 → 262144 262144 → 262144 0 → 0
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 0.990 → 0.990 (+0.0pp) 255592 → 255592 262144 → 262144 3862 → 3862 (1.000×)

frame timing (ms)

cell avg p99
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 479.69 → 503.43 (+4.9%) 1653.38 → 1774.82 (+7.3%)
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 1272.08 → 1306.81 (+2.7%) 2518.74 → 2626.17 (+4.3%)
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 630.81 → 674.30 (+6.9%) 10984.86 → 12274.54 (+11.7%) ⚠
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 1729.33 → 1771.66 (+2.4%) 2941.51 → 3075.03 (+4.5%)

GPU frame timing (ms; separate from stage samples)

cell envelope (base→head) buffer spans (base→head) coverage (base→head)
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 unavailable → unavailable unavailable → unavailable unavailable → unavailable

GPU stage timing (avg ms per sampled invocation)

cell canvasClear voxelCompact voxelStage1 voxelCardinalElect voxelStage2 voxelSunFaces textToTrixel buildLightOcclusionGrid computeVoxelAO bakeSunShadowMap computeSunShadow computeLightVolume lightingToTrixel fogToTrixel trixelToFb resolvePerAxisScreenDepth fbToScreen
target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1 64.49→66.34 68.13→68.13 60.43→60.48 1.03→1.04 57.58→57.38 5.69→5.52 — 0.00→0.00 0.27→2.87 ⚠ 6.23→15.50 ⚠ 15.56→16.23 22.56→23.08 3.69→3.92 1.37→1.42 0.20→0.22 ⚠ — 8.19→8.33
target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1 116.70→119.81 427.16→432.58 261.68→262.74 4.03→4.05 230.80→231.70 4.70→5.16 — 0.00→0.00 0.25→2.44 ⚠ 16.37→27.08 ⚠ 12.94→13.45 19.12→19.74 7.53→8.43 ⚠ 1.32→1.54 ⚠ 0.18→0.21 ⚠ — 7.67→7.79
target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1 57.68→58.87 81.48→82.97 66.70→68.01 12.45→13.12 51.12→51.16 8.16→8.28 0.92→0.92 0.00→0.00 0.88→1.06 ⚠ 52.44→63.74 ⚠ 14.24→15.14 53.74→56.50 7.71→7.96 1.88→1.90 0.18→0.22 ⚠ 0.00→0.00 9.20→9.45
target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1 126.43→128.65 546.84→549.66 426.25→428.04 6.33→6.46 363.98→371.45 5.26→5.85 ⚠ 0.94→0.92 0.00→0.00 0.69→0.73 12.15→24.44 ⚠ 13.18→14.38 18.81→19.48 6.02→6.84 ⚠ 1.35→1.52 ⚠ 0.18→0.19 0.00→0.00 7.68→7.89

top CPU systems by avg ms (head)

target=IRLuaPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 259.823 → 261.822 (+0.8%)
RENDER ComputeLightVolume 37.661 → 38.805 (+3.0%)
RENDER CanvasToFramebuffer 18.125 → 18.753 (+3.5%)
RENDER BakeSunShadowMap 0.238 → 10.376 (+4259.7%) ⚠
RENDER ComputeSunShadow 6.157 → 7.859 (+27.6%) ⚠
UPDATE PropagateTransform 4.992 → 5.160 (+3.4%)
RENDER LightingToTrixel 3.820 → 4.067 (+6.5%)
UPDATE FogRevealEval 3.808 → 3.976 (+4.4%)

target=IRLuaPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1043.404 → 1054.197 (+1.0%)
RENDER ComputeLightVolume 31.649 → 32.672 (+3.2%)
RENDER ComputeSunShadow 16.333 → 20.840 (+27.6%) ⚠
RENDER CanvasToFramebuffer 16.630 → 17.350 (+4.3%)
RENDER ComputeVoxelAO 9.193 → 9.408 (+2.3%)
RENDER LightingToTrixel 7.758 → 8.655 (+11.6%) ⚠
RENDER BakeSunShadowMap 0.236 → 8.625 (+3554.7%) ⚠
UPDATE PropagateTransform 4.765 → 4.899 (+2.8%)

target=IRPerfGrid,zoom=1,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 290.184 → 296.094 (+2.0%)
RENDER ComputeSunShadow 51.563 → 56.295 (+9.2%)
RENDER ComputeLightVolume 35.815 → 37.543 (+4.8%)
RENDER LightingToTrixel 33.295 → 35.313 (+6.1%)
RENDER BakeSunShadowMap 3.645 → 22.465 (+516.3%) ⚠
RENDER CanvasToFramebuffer 18.265 → 18.426 (+0.9%)
RENDER FogToTrixel 6.954 → 7.064 (+1.6%)
UPDATE PropagateTransform 6.821 → 6.984 (+2.4%)

target=IRPerfGrid,zoom=4,sub_mode=full,sub_base=1

pipeline system avg ms (base→head)
RENDER SingleVoxelToCanvasFirst 1475.114 → 1490.392 (+1.0%)
RENDER ComputeLightVolume 31.550 → 33.377 (+5.8%)
RENDER ComputeSunShadow 12.076 → 18.100 (+49.9%) ⚠
RENDER CanvasToFramebuffer 16.579 → 17.245 (+4.0%)
RENDER BakeSunShadowMap 0.237 → 8.835 (+3627.8%) ⚠
RENDER ComputeVoxelAO 7.600 → 7.643 (+0.6%)
RENDER LightingToTrixel 6.207 → 7.028 (+13.2%) ⚠
UPDATE PropagateTransform 6.704 → 6.853 (+2.2%)

@jakildev jakildev added fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved and removed human:re-review Human pushed changes to an approved PR — fleet should re-review labels Nov 4, 2026
@jakildev

jakildev commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Holding review: upstream PR #4873 is not yet approved (its earlier approval was dropped when the stack was rebased; #4873 is itself awaiting #4872). This stacked PR will be re-evaluated once the upstream lands an approval label.

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — render: keep text input values and cursors within their fields

Verdict: approve

Stacked on #4873 (cross-author, fleet:approved). Reviewing the child diff only; approval assumes #4873 lands first. The PR has no Closes #N, so there is no acceptance grading.

The PR does what its description says. A single pure function, textInputViewport, now owns both the visible substring and the cursor rect. The renderer and the layout audit read it, so the audit still measures the text the renderer draws (via the textInputText wrapper). The stored value and cursorPos_ are untouched, so there is no serialization change and no kSaveVersion impact.

What I checked

  • Window math, traced by hand.
    • inset <= width/2 makes innerWidth >= 0, and cursorWidth = min(cw, innerWidth) makes capacity >= 0.
    • first = clamp(cursor - capacity/2, 0, max(0, length - capacity)) always gives 0 <= cursor - first <= capacity.
    • So the cursor stays inside the field when cursor == length, when length < capacity, and for zero, one, or tiny widths.
    • substr(first, capacity) has first <= length, so it cannot throw.
  • Lifetime. TextRun::text_ is a string_view of textInput.text_. It is queued in the same tick call, before any edit, and the struct already documents "views a string the caller owns for as long as the run is queued".
  • Cursor behaviour. Cursor X, Y, and the end-of-text clamp match the old formula (pos.x + 2*padding, (h - glyphH)/2) for fields that fit.
  • Consumers. cursorPos_ is only written by system_widget_apply_text_input.hpp and the serializer. There is no click-to-caret mapping that would disagree with the scrolled window. The audit call site (gui_layout_audit.hpp:289) still goes through textInputText.
  • ECS and style.
    • The per-entity tick is unchanged: no getComponent, no allocation, and string_view slicing only.
    • Math goes through IRMath.
    • New names follow the conventions.
    • The new comment states an invariant rather than history.
  • Tests.
    • The two new GuiLayoutAudit cases cover cursor at the end, in the middle, at the start, below zero, and past the end.
    • They also cover empty, short, and narrow fields (widths 0, 1, 10, 18).
    • They assert glyph and cursor containment and that the complete value is unchanged.
    • I traced the expected numbers (e.g. cursor X 18 / 34 / 50 for a 50-wide field with an 8px inset) and they follow from the code.
  • Checks on the head. linux-build, format-check, header-checks, comment-refs, instruction-size, whitespace, closes-lint, perf-gate and gate are green. fleet-tests was skipped (no scripts touched).
  • What I did not run. I did not build or run the tests or the editor workflow myself. The 52/52 GUI suite and the 11/11 editor workflow are the author's macOS runs; CI linux-build is the only build I rely on.

Nits (follow-up)

  • widget_text_layout.hpp:259 — textInputText is now a one-line wrapper. Its only callers are the layout audit and the older audit test (gui_layout_audit_test.cpp:449). Fine to keep; fold the callers onto textInputViewport next time one of those files is touched.
  • PR body — it discloses that a long unfocused value shows its suffix when the insertion point is at the end. If that reads badly in the editor, an unfocused-shows-prefix rule is a one-line follow-up, but it is a product call and not a defect here.

Praise

  • Putting the window computation in the shared layout header removes the formula that the renderer and the audit each carried a copy of. The audit stays a true measurement of what is drawn.

Test plan the author should run before merge

  • Windows/OpenGL smoke is already tracked via fleet:needs-windows-smoke (a post-merge ledger entry, not a gate).

Escalation: none. Safe for merge.

🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)

Opus recheck not required.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge and removed fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved fleet:reviewing-mac-pool-1 labels Nov 4, 2026
@jakildev
jakildev merged commit 34ed50e into master Nov 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fleet:approved Fleet reviewer approved — ready for human merge fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant