Repository navigation
test(core): 带 resize 时间线的回放工具(解阻 #194) - #265
Merged
Merged
Conversation
现有 replay 只能按固定几何回放整段捕获,因此跨 DPI/缩放/窗口恢复的捕获无法忠实回放—— #194 要核对的正是「resize 期间的重绘与视口/缓冲是否对齐」,缺的正是这个手段。 resize_replay 读取同一份字节流,但按外部步骤文件依次应用几何: <rows> <columns> <bytes> [label] 每一步先 Screen::resize(),再消费相应字节,并输出该步的 history/retained/top/ maximum_top/following/cursor。最后一行输出整份 screen JSON。 验证: - 合成用例:3 行视口喂 12 行后 resize 到 5 行再喂 8 行,history 10→16、 retained 分别等于 history + 当前页高 - 与现有 replay 对拍:本项 #194 的 geometry-main 块在 7x111 下, 两者都得到 retained=37 / history=30 - 新增 test_resize_replay.py 三条用例并注册 CTest resize_replay_contract
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与最终行为
#194要核对「resize 期间的 ConPTY 重绘与终端视口/缓冲是否对齐」,但现有replay只能按固定几何回放整段捕获:跨 DPI / 缩放 / 窗口恢复的捕获(
144 → 192 → 96 → zoom75 → restored)无法忠实回放,这也是在 #194 里只能做单块回放、无法检验跨 resize 假设的原因。本 PR 新增
resize_replay:读取同一份字节流,按外部步骤文件依次应用几何。每一步:
Screen::resize()→ 消费对应字节 → 输出该步状态:{"step":1,"label":"geometry-main","rows":7,"columns":111,"consumed":1650, "total_consumed":1650,"history":30,"retained":37,"top":30,"maximum_top":30, "following":true,"cursor_row":6,"cursor_column":0}最后一行输出整份
screenJSON(与replay相同格式)。验证
replay对拍:[R2][调查] 核对 resize 期间 ConPTY 重绘与终端视口/缓冲的对齐 #194 的actions-geometry-main.transport.bin在7×111下,两者都得到
retained=37 / history=30,新工具未改变回放语义。history 10→16、retained分别等于history + 当前页高(13 / 21),视口始终following。断言
history为17 / 11 / 0,且retained始终等于history + 页高。对应 [R2][调查] 核对 resize 期间 ConPTY 重绘与终端视口/缓冲的对齐 #194 在真实捕获上测到的「7 行页高推入 30 行历史、24 行页高推入 0 行」。
test_resize_replay.py四条用例,注册为 CTestresize_replay_contract,本机通过:性能影响(如适用)
不适用。新增离线诊断工具,运行期路径不调用;工具本身只做一次流式
feed。来源与限制
geometry-main/geometry-bottom两块,且进度日志没有字节偏移字段CMakeLists.txt与 perf(r54): 把冻结成本批次与 hosted/CPU 诊断重放到 main(合并 #104–#107) #262、feat(core): 叠加式显示页坐标映射层(#29 的 view_mapping) #264 插入点相邻:本 PR 在replay之后加可执行目标、在core之后加 Python 测试注册;合并时若冲突只需保留全部插入