Skip to content

fix(candidate): 完整保留流式 emoji 字素、宽度和复制语义 - #49

Merged
JavaZeroo merged 5 commits into
mainfrom
fix/streaming-graphemes-r39
Oct 26, 2026
Merged

JavaZeroo merged 5 commits into
mainfrom
fix/streaming-graphemes-r39

Conversation

@JavaZeroo

@JavaZeroo JavaZeroo commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

候选核心按 scalar 放置输入,导致 👩‍💻 分裂成两个宽单元格、1️⃣ 仅占一列。此 PR 在已选的 Term/Processor 路线中加入有界流式字素状态,保留完整原文,并让宽度、光标、选择复制、实际 DWrite glyph 与真实 resize 一致。默认自研核心未扩展。

合同见 streaming-graphemes.md:feed/snapshot 不封口,SGR/查询透明,首标量样式归属,状态变更封口;每片 64 标量/256B,超限无损分片并显式标记。单列窗口保留完整字素并标明 clipped footprint,修正原 wide reflow 可能无法结束的分支。

独立 Spec 复核发现并修正了三条真实反例:换行 leading spacer 混入复制、在 wide trailer 开始 INSERT 拆散旧宽字符、U+070F Prepend 被后继字符覆盖。Standards/Spec 最终均无遗留阻塞;源码/证据元数据两项补核已完成。

验证与来源:

  • 新鲜主线基线原 4 个 whole/逐字节用例全红,新实现全绿;原件随合成 proof 保留。
  • 固定 unicode-segmentation 1.13.3,与 unicode-width 0.2.2 同为 Unicode 17;许可/锁文件/MSRV 已审计。官方 766 个用例只验证分段 helper,不冒充完整终端正确性。
  • 164 Rust、6 Python 测试通过;最终 10/10 focused CTest 含完整 candidate_shell_tui/differential、三个真实应用(Vim 使用已有进程局部 PATH,无跳过)。
  • 两次 owned ConPTY:80×24→子进程独立确认 100×30;真实拖选复制、完整 glyph、保留/全帧一致;退出与 Job 回收分别核对。
  • 原完整 CTest 45/46 的 Vim PATH 失败及内部 skip 保留。最终全量重建后,本机候选 47/47 CTest 通过(352.90秒),无Vim跳过;内部仍有7个既有unittest跳过:6个需disposable hosted VM的真实系统剪贴板/UI用例,1个opt-in参考程序故障注入。没有新增skip/timeout。产品/测试来源固定d8,4131仅两份docs差异;本地保留267源文件、47二进制身份与完整日志,未把不同源码拼成一次运行。
  • 公开 proof 保留 34 项原工作树哈希,并另列固定提交 Git blob SHA/换行映射、二进制身份和原样合成样本。

性能仍有明确成本: 同宿主交错 3 对、每次至少 1 秒的 CPU 诊断中,project 吞吐中位数下降 16.27%,interactive 下降 9.40%。全部 12 个样本和身份公开。共享宿主、allocator 包装以及缺少传输/呈现/输入时延端点使这不是正式性能验收;#34 必须继续处理,不能用正确性通过豁免;具体由 #54 阻塞 #34。

Refs #39, #30, #34。#30 与完整 R2 继续开放;不声明任意脚本/字体、真实不同 DPI、WindTerm 运行时或性能等价。

#48 已合并,当前 base 为 main。

最终 4131cc4 的默认 Windows/Ubuntu CI与候选 CI全部通过。首个候选CI因完整投影新增计数器而失败的日志保留;d8ac67c 的独立完整状态/旧新摘要迁移和错误摘要负例17/17通过,未修改产品、负载、时间端点或排除新字段。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T08:27:53.837224Z 23616d1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23616d13c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +302 to +303
if wrapped.first().is_some_and(|cell| cell.flags().contains(Flags::WIDE_CHAR_SPACER)) {
wrapped.remove(0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the removed spacer's soft-wrap flag

When a two-column row contains a wide glyph followed by a soft-wrapped continuation (for example, printing 中A in a two-column terminal), WRAPLINE resides on the glyph's trailing spacer. Resizing to one column removes that spacer here and takes the wrapped.is_empty() exit without transferring its wrap flag to the clipped lead. Consequently, tf_terminal_row_meta reports that the row no longer continues, selection/copy introduces a newline into the original text, and a later width increase does not rejoin the rows because grow_columns requires WRAPLINE. Preserve the spacer's continuation flag on the retained cell before removing it.

Useful? React with 👍 / 👎.

@JavaZeroo
JavaZeroo changed the base branch from docs/r2-acceptance-map to main October 26, 2026 08:31
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