Skip to content
C.W.K.
Stream
Lesson 03 of 05 · published

The Native IME Dragon

~13 min · ime, war-story, bounded-experiments, hangul, performance

Level 0Cold Draft
0 XP0/38 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete
"Track 02 said the dragon was real. Then the dragon showed up on camera."

The Bill Comes Due

The 2026-07 quest priced the risk honestly: hand-rolled editors die at IME composition, so Rekindle borrowed a core that had already survived it. v4 changed the terms — a native editor owns the composition lifecycle itself. Nothing about the dragon got smaller; the family just chose to meet it with the platform's text system instead of a JavaScript core. What follows is what that meeting actually looked like. It's the reason the old warning stays taught: the risk was real, priced correctly, and still had to be paid in full.

Four Bounded Experiments

Two days after the cutover, Dad's typing started to hitch. The response was not a root-cause crusade — it was a series of bounded experiments, each explicitly approved before it ran. One: isolate the editor from SwiftUI redraws and skip per-keystroke restyling — Dad's verdict: no change at all. Two: defer recovery disk writes until typing pauses — English unchanged, Korean input broke; reverted. Both are now recorded in the architecture doc as do not repeat these, which is the difference between a rejected experiment and a mystery. Three: move the two-second sync-ledger query off the editor thread — a measured median 23.5 ms per query on office's data — with stale-result guards; the hitch improved only slightly. Four: category-specific disk-monitor invalidation, so a background write no longer triggers a full library rescan mid-keystroke — substantially better, not gone. And there Dad closed the investigation at diminishing returns: an accepted residual, written down as one.

The coda arrived two days after the hunt closed, and cost nothing: after a reboot and the macOS 26.7 update, the hitch was simply gone, and a fresh input-active sample showed Korean key-down time dominated by IME XPC wait — the platform's, not the app's. The shipped experiments stayed shipped (they were measured wins); the hunt stayed closed. Sometimes the platform moves under you in both directions.

The Hangul-Loss Capture

The second visit was weirder and better documented. On 2026-09-17, live on a real note, Korean characters vanished from the display while staying intact on disk. The capture: a missed ⌘Space input-source toggle (the system ate the shortcut; it never reached the editor), then the draw pass recorded 36 null glyphs at Courier's advance — because Courier has no Hangul outlines. The source was never lost; the recovery snapshot was clean; the guard that watched source counts saw nothing wrong, because nothing in the source was wrong. The fix is a defense in three parts: an explicit Apple SD Gothic Neo cascade so Hangul always has a glyph, a restyle on keyboard-selection change, and an Undo that redraws collapsed glyphs without touching the document. The earlier 'it disappeared when I retyped' reports turned out to be typing over invisible characters — the bug wore a data-loss costume the whole time.

Code

The experiment ledger — four approved, two rejected, one closed by the platform·text
hunt: typing hitch (post-cutover, both languages)

exp 1  isolate editor from SwiftUI redraws     -> NO CHANGE (rejected)
exp 2  defer recovery writes until pause       -> KOREAN BROKE (rejected)
       both recorded in the arch doc as: do not repeat
exp 3  sync-ledger query off the editor thread -> slight improvement
       (measured: median 23.5 ms/query, stale-result guards)
exp 4  category-specific disk invalidation     -> substantially better
       closed at diminishing returns — an ACCEPTED residual

coda   macOS 26.7 + reboot -> hitch gone; IME XPC wait was the platform's

hunt: vanishing Hangul (2026-09-17, live capture)
cause  missed ⌘Space -> null glyphs at Courier's advance
       (Courier has no Hangul outlines; the source was never lost)
fix    SD Gothic Neo cascade + restyle on keyboard change
       + Undo redraws collapsed glyphs without an edit

External links

Exercise

Take a bug you've only ever 'fixed' by restarting something. Design its bounded experiment: one variable, one measurement, one revert plan, one stopping rule ('if this doesn't move it, I close the hunt and record the residual'). Then write the two-line entry you'd leave for the person who rediscovers the symptom next year.
Hint
If you can't name the measurement, you don't have an experiment — you have a superstition with extra steps. And if the entry doesn't say what NOT to retry, next year's person pays full tuition again.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.