Skip to content

feat(qt): 固定 Unicode 样本贯通 Qt 呈现与独立 child 接收(#30 切片) - #313

Merged
JavaZeroo merged 2 commits into
mainfrom
agent/unicode-qt-verify-e11985a21ddf
Nov 4, 2026
Merged

JavaZeroo merged 2 commits into
mainfrom
agent/unicode-qt-verify-e11985a21ddf

Conversation

@JavaZeroo-Bot

Copy link
Copy Markdown
Collaborator

范围

在同一个正式 C++ / Qt Widgets / 随包固定 Microsoft ConPTY 构建里,补上当前未覆盖的“解析后实际绘制”端到端合同(#30 的一个独立 R2 切片,不消费 #27 隐藏帧决定):

  • 固定 5 条 Unicode 样本:ASCII、CJK、补充平面 emoji、结合标、以及仅记录的 ZWJ/keycap。
  • 链路:公开 Qt 文本事件 → 既有编码器 → 固定 ConPTY → 真实 child ReadConsoleW 精确接收(独立字节 oracle)→ child 按文档化 CR→CRLF 回显同字节 → 核心解析 → TerminalWidget 绘制 → 离屏 QImage 抓图。
  • 断言:receiver/echo 字节逐字节一致、字面 Cell/width/marks、每格实际墨迹、QTextLayout 实测 RawFont fallback 面与 missing glyph、同字体无裁剪参考墨迹落在格内;第二条空会话验证目标隔离。
  • 记录而不批准:U+200D/U+FE0F 仍被 recovery parser 替换为 U+FFFD(现有 Unicode 15 表缺口);emoji advance 21px > 两格 18px,但参考墨迹 3..17px 未越格——仅登记,不外推。

改动

  • src/qt/unicode_render_test.cpp(新):上述合同测试;TerminalWidget 仅新增只读 cell 几何诊断访问器。
  • experiments/shell/unicode_echo_client.cpp(新):独立接收 + 同字节回显夹具,要求处于自有 Job。
  • CMakeLists.txt:新 fixture、qt_unicode_render_test 与 CTest qt_unicode_render(offscreen + OwnedJob supervisor)。
  • CI:.github/workflows/qt-cpp.yml 构建/运行时清单/CTest 选择加入新测试。
  • 文档:experiments/shell/results/2026-11-04-qt-unicode-presentation/(README + validation.json)、src/qt/README.md、docs/FEATURES.md、docs/EVIDENCE.md。

验证(同源码实测)

  • Qt 正式路径 CTest 6/6(qt_cpp_shell、qt_unicode_input、qt_unicode_render、qt_cpp_resize、qt_terminal_modes、qt_terminal_modes_retained,9.92 s)。
  • 新测试连跑两次通过;receiver SHA-256 32a5695a…、echo SHA-256 96ae6f16… 两次一致,除 child pid 与一个混合 cell 的 fallback 面顺序外逐字段一致。
  • 默认/核心配置 CTest 41/41(27.61 s,含 core 的 16 项核心 + 15 项 Unicode Python 测试、keyboard、recovery、resize_replay_contract 及全部 *_core)。
  • 实测字体:CJK → 宿主 Alibaba PuHuiTi;emoji → Segoe UI Emoji;ASCII/结合标 → 随包 Roboto Mono(sha256 af0bff75…)。

已知缺口与边界

复验与全部身份见 固定结果。

JavaZeroo-Bot and others added 2 commits November 4, 2026 18:15
Add qt_unicode_render: a fixed five-sample set (ASCII, CJK, supplementary
plane, combining mark, record-only ZWJ/keycap) goes through the formal Qt key
path into a real child, whose ReadConsoleW receive file is the independent byte
oracle; the child echoes the same bytes with CR->CRLF and the widget paints the
parsed Screen offscreen. The test asserts exact receive/echo bytes, literal
Cell/width/marks, per-cell painted ink, actual RawFont fallback faces and
missing-glyph count, and an unclipped reference ink bound; a second empty
session observes target isolation.

Measured locally: CJK renders with host Alibaba PuHuiTi, two emoji with Segoe UI
Emoji (advance 21 px over an 18 px span but reference ink 3..17 stays inside),
the combining mark keeps marks=1, and U+200D/U+FE0F are still replaced by U+FFFD
by the recovery parser (recorded gap, no new clustering/width policy). The
capture is offscreen only: presented_done=null, not physical presentation or
native IME.

Add the independent echo fixture and the cell-geometry diagnostics, register the
target and runtime manifest in the Qt CI job, and record the evidence. Qt
formal-path CTest 6/6; core CTest 41/41 including the 15 Unicode parser tests.
#30/#155 stay open.

Co-authored-by: JavaZeroo <[email protected]>
Record the final two-run and regression results for qt_unicode_render in
validation.json: exact receive/echo hashes, per-cell glyph families,
missing-glyph counts, advance and ink spans, the ZWJ/keycap recovery gap, and
the fixed dependency/source/binary identities. Also align the report's measured
timings with the final runs.

The recorded implementation sources still match the implementation commit; this
follow-up changes only documentation. #30/#155 stay open.

Co-authored-by: JavaZeroo <[email protected]>
@JavaZeroo-Bot

Copy link
Copy Markdown
Collaborator Author

验证摘要(同源码)

  • 本地 Qt 正式路径 CTest 6/6(qt_cpp_shell、qt_unicode_input、qt_unicode_render、qt_cpp_resize、qt_terminal_modes、qt_terminal_modes_retained,9.92 s)。
  • 新测试 qt_unicode_render 连跑两次通过;receiver SHA-256 32a5695a4b750861291df737ed9c8d4e7a92726172d6f275ba6c88790fd13f1e、echo SHA-256 96ae6f16c2e6449673b10871fc10881c11566a2de150a5dcb759ebca55628028 两次一致;除 child pid 与一个混合 cell 的 fallback 面顺序外逐字段一致。
  • 本地默认/核心 CTest 41/41(27.61 s,含 core 的 16 项核心 + 15 项 Unicode Python 测试、keyboard、recovery、resize_replay_contract 及全部 *_core)。
  • 固定结果、字体/fallback 实测与全部身份:experiments/shell/results/2026-11-04-qt-unicode-presentation/(README + validation.json)。

当前 head CI

  • Qt C++ fixed ConPTY build and smoke(PR run) success,其中 qt_unicode_render 在 windows-2025 上通过(3.33 s);push run 同样 success。
  • Build and synthetic regression 的 ubuntu-24.04 job、External core candidate 的 ubuntu-24.04 job 已 pass;截至本评论,两个 windows-2025 regression job 与一个 windows-2025 alacritty job 仍在排队(未失败)。

CI 环境的字体观察(记录,不当作通过)

CI 的 windows-2025 镜像没有可用的 CJK fallback 面(host_fallback_rendered=false,某些 CJK cell missing_glyphs>0),测试按设计记录该环境限制并通过;emoji 由 Segoe UI Emoji 正常渲染。本地宿主有 fallback(CJK Alibaba PuHuiTi、emoji Segoe UI Emoji),所以本地证据包含实际 fallback 面;两者都不支持“通用 fallback 已验收”的结论。

边界

U+200D/U+FE0F 仍被 recovery parser 替换为 U+FFFD(只记录,未新增字素/宽度策略);offscreen 局部证据,presented_done=null,不是物理呈现/原生 IME/真实 DPI 验收;#30/#155/#7 不关闭;不触发 Codex review,不启用自动合并。

@JavaZeroo
JavaZeroo merged commit 4caff3b into main Nov 4, 2026
10 checks passed
JavaZeroo-Bot added a commit that referenced this pull request Nov 4, 2026
Resolve docs/EVIDENCE.md and docs/FEATURES.md conflicts by keeping both
#313's fixed-Unicode Qt presentation evidence and its limits and #314's
confirmed hidden-frame full-body decision, intentional-difference record and
formal-path status. No production or frozen-record changes; the preserved
strict audit failure, offline supplement and semantic_acceptance=false keep
their identity.

Co-authored-by: JavaZeroo <[email protected]>
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