Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/EVIDENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ R1 固定总出口的源码为 `ce9b24d`,早期 `2dc8d6d` / `9b16acc` 仍分

| 范围 | 结果与复现入口 | 可以支持的结论与限制 |
|---|---|---|
| 行存储封存与结构单一发布(#169 第二片) | [固定结果](../experiments/core/results/2026-10-29-sealed-row-storage/README.md)、[验证身份](../experiments/core/results/2026-10-29-sealed-row-storage/validation.json) | `Screen::lines/history` 私有,只读口 + 23 文件/363 处迁移;Find overlay 改文档 rank;默认 Release 构建 exit 0、核心 8/8、扩展快测 20/20、candidate 源 /W4 编译 0。无新 VT/重排行为;运行中跨重排 Search、Qt 与候选运行由宿主作业复核。 |
| 默认核心缩小与重绘交错(#156) | [固定四-case机制诊断](../experiments/shell/results/2026-10-29-resize-repaint-witness/README.md)、[脱敏验证](../experiments/shell/results/2026-10-29-resize-repaint-witness/validation.json) | A/C保留2499B,B/D在第五段重绘首次失效且行分配路径不同;只见证机制,原CI切点/根因未知,未修生产。witness结束后Job仍active1,发起一次终止后归零;成员身份/逐句柄退出未知,不称全树自然退出。 |
| 持续 cmd 输出与原始 Ctrl-C 回归(#36 未关闭) | [受监督入口](../experiments/conpty/README.md#持续-cmd-输出与-ctrlc-独立回归)、[三次 fresh 公开记录及本地字节复核](../experiments/conpty/results/2026-10-26-ctrl-c-retest/validation.json) | 原百万次输出、单次 ETX、五秒期限和退出 37 保留;三次 fresh 原始字节/Job0 本地重算。后续成功未解释历史失败,未改产品 Ctrl-C 路径。 |
| 持续输出中断的原失败记录 | [#36](https://github.com/JavaZeroo/termforge/issues/36)、[ConPTY 输入机制研究](research/conpty-ctrl-c-input.md)、[原 R1 历史证据](../experiments/shell/results/2026-10-23-r1-foundations/validation.json) | 原 Windows 11 回归中的 normal/resize 超时与 ETW/插桩观察;调试扰动及管道读完成缺口保留。不是当前全套结果,后续未复现不能抹去此失败。 |
Expand Down
46 changes: 23 additions & 23 deletions experiments/core/alternate_mode_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ static void enter_and_restore(ParseMode mode) {
check(parser.screen.row == 0 && parser.screen.column == 0 &&
parser.screen.style.fg == -1 && parser.screen.style.bg == -1,
"1049 entry did not home the cursor with default writing colours");
check(text(parser.screen.lines[0]) == " ", "alternate entry retained primary text");
check(text(parser.screen.visible_lines()[0]) == " ", "alternate entry retained primary text");
parser.feed("ALT\x1b[?1049l");
check(parser.screen.active_buffer() == ScreenBuffer::primary &&
text(parser.screen.lines[0]) == "MAIN " &&
text(parser.screen.visible_lines()[0]) == "MAIN " &&
parser.screen.row == 0 && parser.screen.column == 4,
"1049 exit did not restore primary text and cursor");
check(parser.screen.style.fg == 1 && parser.screen.style.bg == 4,
Expand All @@ -41,30 +41,30 @@ static void repeated_entry_and_exit(ParseMode mode) {
check(parser.screen.row == 0 && parser.screen.column == 0 &&
parser.screen.style.fg == -1 && parser.screen.style.bg == -1,
"repeated 1049 entry did not home with default writing colours");
check(text(parser.screen.lines[0]) == " " && text(parser.screen.lines[2]) == " ",
check(text(parser.screen.visible_lines()[0]) == " " && text(parser.screen.visible_lines()[2]) == " ",
"repeated 1049 entry retained old alternate text");
parser.feed("NEW\x1b[?1049l!\x1b[?1049l?");
check(text(parser.screen.lines[0]) == "MAIN!? " && parser.screen.column == 6,
check(text(parser.screen.visible_lines()[0]) == "MAIN!? " && parser.screen.column == 6,
"repeated entry overwrote primary state or repeated exit rewound it");
check(parser.screen.style.fg == 1 && parser.screen.style.bg == 4,
"alternate colour writes changed saved primary colours");
parser.feed("\x1b[?1049h");
check(text(parser.screen.lines[0]) == " " && parser.screen.column == 0,
check(text(parser.screen.visible_lines()[0]) == " " && parser.screen.column == 0,
"1049 re-entry retained text from the earlier alternate visit");
parser.feed("\x1b[?1049l");
check(text(parser.screen.lines[0]) == "MAIN!? " && parser.screen.column == 6,
check(text(parser.screen.visible_lines()[0]) == "MAIN!? " && parser.screen.column == 6,
"later primary writes were not preserved across re-entry");
parser.finish();
}
static void pending_wrap_roundtrip(ParseMode mode) {
Parser parser(25, 91, 2, mode);
parser.feed("\x1b[3;91HW\x1b[?1049hALT\x1b[?1049lX");
check(parser.screen.row == 3 && parser.screen.column == 1 &&
text(parser.screen.lines[2]) == std::string(90, ' ') + "W" &&
text(parser.screen.lines[3]) == "X" + std::string(90, ' '),
text(parser.screen.visible_lines()[2]) == std::string(90, ' ') + "W" &&
text(parser.screen.visible_lines()[3]) == "X" + std::string(90, ' '),
"return lost the primary pending wrap before the next printable byte");
check(parser.screen.lines[2].ending == LineEnding::soft_wrap &&
parser.screen.lines[2].next_id == parser.screen.lines[3].id,
check(parser.screen.visible_lines()[2].ending == LineEnding::soft_wrap &&
parser.screen.visible_lines()[2].next_id == parser.screen.visible_lines()[3].id,
"restored pending wrap did not preserve the real continuation");
parser.finish();
}
Expand All @@ -85,24 +85,24 @@ static void observed_colour_trace(ParseMode mode, size_t split, bool bytewise) {
const auto& screen = parser.screen;
check(screen.active_buffer() == ScreenBuffer::primary && screen.row == 3 && screen.column == 34,
"five-stage trace ended in the wrong primary cursor state");
check(text(screen.lines[1]) == " D0 H H" + std::string(83, ' ') &&
text(screen.lines[3]) == " M0 H H M1 H M1S1 H M1S2 H M1D0 H" + std::string(57, ' '),
check(text(screen.visible_lines()[1]) == " D0 H H" + std::string(83, ' ') &&
text(screen.visible_lines()[3]) == " M0 H H M1 H M1S1 H M1S2 H M1D0 H" + std::string(57, ' '),
"five-stage trace did not preserve the literal primary text");
check(screen.lines[3][12].text == "H" && screen.lines[3][12].style.fg == 1 &&
screen.lines[3][12].style.bg == 4 && screen.lines[3][33].style.fg == -1 &&
screen.lines[3][33].style.bg == -1,
check(screen.visible_lines()[3][12].text == "H" && screen.visible_lines()[3][12].style.fg == 1 &&
screen.visible_lines()[3][12].style.bg == 4 && screen.visible_lines()[3][33].style.fg == -1 &&
screen.visible_lines()[3][33].style.bg == -1,
"return output did not use restored main colours and the explicit default control");
}
static void history_and_resize(ParseMode mode) {
Parser parser(2, 8, 3, mode);
parser.feed("A\r\nB\r\nC\r\nD\x1b[?1049hX\r\nY\r\nZ\r\nT");
check(parser.screen.history.empty(), "alternate output entered retained history");
check(parser.screen.history_lines().empty(), "alternate output entered retained history");
parser.screen.resize(3, 6);
parser.feed("\x1b[?1049l");
const auto& screen = parser.screen;
check(screen.height() == 3 && screen.width() == 6 && screen.history.size() == 2 &&
text(screen.history[0]) == "A " && text(screen.history[1]) == "B " &&
text(screen.lines[0]) == "C " && text(screen.lines[1]) == "D " &&
check(screen.height() == 3 && screen.width() == 6 && screen.history_lines().size() == 2 &&
text(screen.history_lines()[0]) == "A " && text(screen.history_lines()[1]) == "B " &&
text(screen.visible_lines()[0]) == "C " && text(screen.visible_lines()[1]) == "D " &&
screen.row == 1 && screen.column == 1,
"1049 output or resize changed the saved primary history and writing position");
parser.finish();
Expand Down Expand Up @@ -151,7 +151,7 @@ static void recovery_keeps_private_sequences_separate() {
parser.feed(sequence + "\x1b[31mR");
parser.finish();
check(parser.screen.active_buffer() == ScreenBuffer::primary &&
text(parser.screen.lines[0]) == "R " && parser.screen.lines[0][0].style.fg == 1 &&
text(parser.screen.visible_lines()[0]) == "R " && parser.screen.visible_lines()[0][0].style.fg == 1 &&
parser.diagnostics().ignored_sequences == 1 && parser.diagnostics().max_sequence_bytes <= 33,
"an unsupported private sequence mutated a buffer or contaminated the next CSI");
}
Expand All @@ -160,12 +160,12 @@ static void recovery_keeps_private_sequences_separate() {
parser.feed(std::string("\x1b[?1049") + cancellation + "\x1b[31mR");
parser.finish();
check(parser.screen.active_buffer() == ScreenBuffer::primary &&
text(parser.screen.lines[0]) == "R " && parser.screen.lines[0][0].style.fg == 1,
text(parser.screen.visible_lines()[0]) == "R " && parser.screen.visible_lines()[0][0].style.fg == 1,
"cancellation or ESC resynchronization retained the private prefix");
}
Parser truncated(2, 8, 1, ParseMode::recovery);
truncated.feed("\x1b[?1049"); truncated.finish(); truncated.feed("\x1b[31mR"); truncated.finish();
check(truncated.screen.active_buffer() == ScreenBuffer::primary && truncated.screen.lines[0][0].style.fg == 1,
check(truncated.screen.active_buffer() == ScreenBuffer::primary && truncated.screen.visible_lines()[0][0].style.fg == 1,
"truncated private input contaminated the next normal CSI");
}
static void identical_repeated_text_is_a_new_document(ParseMode mode) {
Expand All @@ -188,7 +188,7 @@ static void strict_rejects_unsupported_private_modes_atomically() {
try { parser.feed(input); }
catch (const InputError&) { rejected = true; }
check(rejected && parser.screen.active_buffer() == ScreenBuffer::primary &&
text(parser.screen.lines[0]) == "MAIN " &&
text(parser.screen.visible_lines()[0]) == "MAIN " &&
parser.screen.style.fg == 1 && parser.screen.style.bg == 4,
"strict private dispatch accepted an unsupported command or partially applied its modes");
}
Expand Down
Loading