Skip to content

diagnose(shell): flag resize repaint batches in the output trace (#194) - #198

Merged
JavaZeroo merged 1 commit into
mainfrom
diag/repaint-flag
Oct 29, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
diag/repaint-flag

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

内容

输出轨迹增加 repaint 标记:当被消费的输出块包含 resize 重绘前缀 ESC[?25l ESC[H 时标为 true。

{"schema":"termforge-output-trace-v1","terminal":1,"t_ms":...,"offset":3301,"bytes":210,"columns":112,"rows":7,"repaint":true}

用途(#194 可行性实验)

文档 conpty-resize-repaint-timing.md 固定了实施前必须确认的问题:重绘批次是"resize 前生成、resize 后到达"还是相反。有了 repaint 标记,就可以把每次重绘的消费时刻尺寸与进度记录的 geometry-* 阶段直接对齐,不必再靠推断。

本地验证

test_actions 本地场景 OK;output-trace 752 行,其中 repaint=true 8 条
{"terminal":2,"columns":74,"rows":17,"repaint":true}
{"terminal":1,"columns":112,"rows":7,"repaint":true}

边界

Refs #194

…194

A chunk containing the cursor-hide plus home prefix is marked repaint:true together with the grid it was consumed at, which is the missing input for deciding whether the repaint was generated before or after the resize.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T18:19:01.933322Z 2044049 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: 2044049a7f

ℹ️ 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".

// A resize repaint starts by hiding the cursor and homing it;
// flagging it lets the trace show whether the batch was built
// for the previous grid but consumed with the new one.
const bool repaint = bytes.find("\x1b[?25l\x1b[H") != std::string::npos;

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 Detect repaint prefixes across output chunk boundaries

When the repaint prefix straddles two consumed chunks, both trace records report repaint:false, hiding the repaint from the timing investigation. OutputQueue::take(8192) in experiments/shell/queues.hpp splits the byte stream without respecting escape-sequence boundaries: for example, 8,188 ordinary bytes followed by this prefix splits it across two chunks, neither of which matches this search. Retain the trailing prefix-length-minus-one bytes between searches, or use a streaming matcher, so detection does not depend on transport chunking.

Useful? React with 👍 / 👎.

@JavaZeroo
JavaZeroo merged commit d79dbb0 into main Oct 29, 2026
14 of 16 checks passed
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