Skip to content

test(cpu-subtitle-test): SubRip/WebVTT/ASS subtitle parse carpet - #1872

Open
Lfan-ke wants to merge 1 commit into
rcore-os:devfrom
Lfan-ke:apps-starry-cpu-subtitle-test
Open

test(cpu-subtitle-test): SubRip/WebVTT/ASS subtitle parse carpet#1872
Lfan-ke wants to merge 1 commit into
rcore-os:devfrom
Lfan-ke:apps-starry-cpu-subtitle-test

Conversation

@Lfan-ke

@Lfan-ke Lfan-ke commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

概述

apps/starry/cpu-subtitle-test:字幕 carpet(C 侧纯 CPU)。自写 SRT/VTT/ASS 解析器(libc-only 静态);每断言都是精确毫秒时间戳 / cue 结构 / 编码对确定性 golden 硬断言。断言只覆盖数量/时间戳/index 序/样式/编码,不嵌入或复现任何字幕对白文本。

Cells 与断言(host 真跑绿, 三门 fail==0 && total==EXPECTED==pass, mutation-tested)

cell 断言
subtitle_srt SubRip 合成 cue: HH:MM:SS,mmm→精确 ms(00:00:01,000→1000)+cue 数+index 1..N+单调不重叠+多行+BOM/CRLF/空文本边界
subtitle_ass ASS [Script Info]/[V4+ Styles]/[Events], Format 列序映射, H:MM:SS.cc 厘秒→ms, 样式表(Name/Font/Size/&HAABBGGRR), override tag 剥离
subtitle_vtt WebVTT header+HH:MM:SS.mmm+cue settings+NOTE 跳过
subtitle_convert SRT↔VTT round-trip 保时间戳精确(逗号 vs 点)+真 ffmpeg srt→vtt 结构交叉
subtitle_realassets 真 srt/ass 仅断言结构: cue/dialogue 数/首末时间戳/单调/UTF-8 合法(自写 RFC-3629), honest-skip

共 108 断言。cells 1-4 全确定(cue 代码内 author)。字幕文件在 git submodule(Lfan-ke/hw4os-s5d1t2 media 分支, git-LFS)经 ASSET_DIR 引用,仓库只放 carpet 代码+结构 golden(避污染主仓)。-Wall -Wextra -static 零警告。

特殊声明:素材仅用于 OS 功能完整性 & 正确性验证,不作他用!有事请找:@Lfan-ke

自写 srt/ass/vtt 解析器+时间戳算术, 零版权对白(纯 ASCII 源, 只断言结构/时间/编码)。

关键文件: carpetsprebuild.sh

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

本 PR 新增 apps/starry/cpu-subtitle-test:以静态 C 程序覆盖 SRT/WebVTT/ASS 的解析、时间戳换算和结构性 golden,并为四个架构提供 build/QEMU 配置。实现与 StarryOS 内核 ABI 无直接变更;功能开发准则适用,按新增的共享、面向操作者的 Starry 应用工作流审查。

阻塞问题

apps/starry/cpu-subtitle-test/README.md 缺少可复现的准备和运行说明(详见本 review 的 body finding)。它没有给出 cargo xtask starry app qemu -t cpu-subtitle-test --arch ... 等启动命令、rootfs/prebuild 所需 qemu-user/e2fsprogs/网络 APK 前置条件、可选 SUBTITLE_ASSET_SRC 的准备方式及预期的 TEST PASSED 标记。基线同类 apps/starry/cpu-concurrency/README.md 明确列出四个架构的运行命令;本场景使用者只能阅读实现来推断流程。请补齐文档,并按文档在当前 head 至少实跑一个声明架构后再请求审核。

已检查的实现和验证

  • git diff --check origin/dev...HEAD 通过;review helper 的自测与 head/base 验证通过。
  • 检查了 README、四份 build/QEMU 配置、prebuild.shrun_all.sh 及五个 C cell。runner 会立即保存子进程退出码,并以 manifest、失败标记和 TEST PASSED/TEST FAILED 传播结果;未发现额外的正确性或内存安全阻塞项。
  • 主机侧以 gcc -O2 -std=c11 -static -Wno-unused-function 编译并运行五个 cell,随后用 /opt/cpu-subtitle-test/run_all.sh 运行,得到 5/5 ... OKTEST PASSED;ASan/UBSan 的五个 cell 亦通过。真实字幕资产和 ffmpeg 在此环境缺失,因此对应 legs 正确打印 SKIP,未覆盖资产路径。
  • bash -n prebuild.shsh -n run_all.shpython3 -m py_compile tools/gen_goldens.py 通过。以 -Wall -Wextra -Werror 独立编译会因 header-only helper 在各 cell 中未使用而失败;这不构成当前阻塞项,因为 PR 的预编译命令明确使用 -Wno-unused-function

CI、覆盖和既有讨论

当前 head 的组织 CI:格式化、clippy 与 loongarch64 Starry QEMU job 成功;aarch64/x86_64/riscv64 Starry QEMU job 被取消,其他矩阵项按 runner/容器分流跳过。没有现有 review、inline 或 issue 评论。CI 未证明这个新增 app 的四份配置中任一配置实际运行了本 carpet,且 PR body 声称的 host 验证不能取代当前 head 的应用 QEMU 验证。

重叠分析与 todo 审计

origin/dev 未找到等价 subtitle/SRT/VTT/ASS 实现;用 subtitle、cpu-subtitle-test 及 apps/starry 检索开放 PR 后,除本 PR 外的广义 apps 命中均为不相关场景,因此不存在重复或依赖关系。应用应位于 apps/starry 而非 test suite,当前位置正确。上述文档和可运行性缺口是唯一未关闭的 todo;其余 current-head、差异、C 实现、runner、既有评论、CI 和重叠检查均已完成。

Powered by gpt-5.6-terra

@mai-team-app
mai-team-app Bot requested a review from YanLien August 4, 2026 16:47
@Lfan-ke
Lfan-ke force-pushed the apps-starry-cpu-subtitle-test branch from f5b1edc to 65c07ae Compare August 4, 2026 22:58

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

本 PR 新增 apps/starry/cpu-subtitle-test,以静态 C 程序覆盖 SRT/WebVTT/ASS 的解析、时间戳换算和结构 golden,并提供四个架构的 build/QEMU 配置。它是新增的共享、面向操作者的 StarryOS app 工作流,适用 feature-development 准则;未改动 StarryOS syscall/Linux ABI,应用与测试套的位置边界正确。

阻塞项见两条行内评论:一是 README 没有可复现的准备、运行和成功判据;二是实际 app 入口在 guest GCC 递归执行 cc1 时失败,QEMU 未启动。请优先修复预构建,补全文档后按文档至少运行一个当前 head 的声明架构。

验证:review_pr_helper.py test 与 head/base 校验通过;git diff --check origin/dev...HEADbash -n prebuild.shsh -n run_all.shpython3 -m py_compile tools/gen_goldens.py 通过。主机侧编译五个 cell 并运行 runner 得到 5/5TEST PASSED(这不替代 app workflow)。实际运行 cargo xtask starry app qemu -t cpu-subtitle-test --arch x86_64:rootfs 下载/扩容和 apk add build-base 成功,随后首个 cell 编译报 cc1: posix_spawn: No such file or directory 并以 status 1 退出。

组织 CI 当前 head 的格式化及部分矩阵成功,但未证明新增 app 的这个 runtime 路径;没有当前头既有 inline/issue 评论。旧的请求修改指向前一 head,且其 README 缺口在本 head 仍存在。基线未找到等价 subtitle 实现;检索开放 PR 未发现与本 app 重复或依赖的变更。除这两个阻塞项外,已审查 runner 的失败传播、配置及 parser 代码;未发现额外阻塞问题。

Powered by gpt-5.6-terra

}

GCC() { QEMU_LD_PREFIX="$staging_root" LD_LIBRARY_PATH="$staging_root/usr/lib:$staging_root/lib" \
"$qemu_runner" -L "$staging_root" "$staging_root/usr/bin/gcc" --sysroot="$staging_root" "$@"; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

严重性:阻塞。这里用 qemu-user 启动 guest 的 gcc,但 GCC 会再用 posix_spawn 直接执行 guest 的 cc1;该子进程没有 qemu-user/binfmt 解释器。按本 PR 声明的入口运行 cargo xtask starry app qemu -t cpu-subtitle-test --arch x86_64 时,rootfs 和 build-base 都准备完成,却在第一个 cell 稳定报 cc1: posix_spawn: No such file or directory,所以 QEMU 根本不会启动。其他三种架构也采用相同机制。请像基线 cpu-concurrency 一样改用宿主 cross compiler 或 zig cc -target(或完整配置递归的 binfmt/QEMU 环境),并至少逐架构验证编译。

subtitle_convert.c # cell 4
subtitle_realassets.c # cell 5
third_party/ # (empty - no vendored dep; all formats self-parsed)
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

严重性:阻塞。该 README 到此处结束仍没有新增 app 的可执行运行说明。基线同类 cpu-concurrency 已列出四个 cargo xtask starry app qemu -t ... --arch ... 命令;这里却未说明启动命令、prebuild.sh 所需 qemu-user/rootfs 工具、可选 SUBTITLE_ASSET_SRC 资产准备和 guest 端应观察到的 TEST PASSED。因此操作者不能按仓库约定复现四个声明架构中的任何一个工作流。请补齐这些准备和运行步骤,并按文档在当前 head 至少实跑一个架构后再提交审核。

@Lfan-ke
Lfan-ke force-pushed the apps-starry-cpu-subtitle-test branch 2 times, most recently from 84935eb to 260476f Compare August 6, 2026 15:06

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

本 PR 新增 apps/starry/cpu-subtitle-test:用静态 C 程序验证 SRT/WebVTT/ASS 解析、时间戳换算和结构性 golden,并提供四个架构的 app/QEMU 配置。它是新增的、面向操作者的 StarryOS app 工作流,适用 feature-development.md(按局部、低风险工作流审查);未改变 StarryOS syscall/Linux ABI,故 syscall 准则不适用。app 放在 apps/starry 而非 CI test suite,层次正确。

阻塞项

唯一阻塞项见行内评论:真实素材测试承诺两个素材都必须存在,但实现把任意一个缺失降级为 SKIP,只要另一个存在就以成功退出。这会让 runner 在缺少一整个格式覆盖时仍输出 TEST PASSED,与 README/prebuild 的完整素材及硬失败约定相矛盾。

实现与验证

  • 已审查四份 build/QEMU 配置、prebuild.shrun_all.sh、五个 C cell、golden 生成器、README 和 submodule 配置;runner 正确立即保存子进程退出码,并通过 manifest 和 TEST PASSED/TEST FAILED 传播失败。
  • review_pr_helper.py test、head/base 校验、git diff --check origin/dev...HEADbash -n prebuild.shsh -n run_all.shpython3 -m py_compile tools/gen_goldens.py 均通过。
  • 使用四套宿主 musl cross compiler 运行 prebuild,x86_64/aarch64/riscv64/loongarch64 均生成五个 cell 和两份素材;完整 x86_64 素材下五个 cell 均通过(32/27/16/9/24 断言)。分别移除 SRT 或 ASS 后,real-assets cell 却仍返回 0,已由行内问题复现。
  • 依 README 实跑 cargo xtask starry app qemu -t cpu-subtitle-test --arch x86_64:rootfs、submodule 初始化、overlay 注入和本 app 的五个 host 交叉编译均完成;QEMU 在 guest 启动前报 PVH ELF 错误。基线 cpu-concurrency 的同一 x86 配置也以相同错误失败,故该运行环境/基线问题不归因于本 PR,未作为本次阻塞项。

CI、既有讨论与重叠检查

当前 head 的组织 CI 有 1 个成功、4 个跳过、1 个失败;失败的 Detect changed pathsSet up job 阶段失败,未执行本 app,不能证明或反证本改动。旧的两条请求修改针对先前 head:README 运行说明和 host-cross-compile 修复已在当前 head 落地;本 review 保留的新问题与它们不同。基线未发现等价 subtitle/SRT/VTT/ASS 实现;以 subtitlecpu-subtitle-testapps/starry 检索开放 PR,未发现重复、依赖或冲突变更。

todo 审计

已完成约束/设计准则、当前 head、历史评论、CI、配置/runner/parser、素材/发现/失败传播、重复分析及本地验证;仅 real-assets 的“任一素材缺失仍通过”阻塞合入。请修复后重新运行至少一个文档化 app workflow,并验证任一素材缺失会使 run_all.sh 失败。

Powered by gpt-5.6-terra

} else { gate_check(&g, 0, "srt parse failed (malformed cue)"); }
free(sbuf);
} else {
fprintf(stderr, " SKIP: tashouheng.srt absent under %s\n", sub_dir());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

严重性:阻塞。README 和 prebuild 都承诺两个真实素材缺任一即失败,但这里把 tashouheng.srt 缺失只打印 SKIP;只要 badapple.ass 存在,have_any 就会绕过 101 行的失败分支,cell 仍以 0 返回。同样的问题也适用于 ASS 缺失。实测分别移除 SRT/ASS 后,cell 仍输出 OK 14/OK 10 并退出 0。这样部分素材未被 stage 时会静默丢掉整个格式的断言,而 run_all.sh 仍可打印 TEST PASSED。请分别记录两个素材是否存在,并对任一缺失加入失败 gate;不要用“至少一个存在”代替完整覆盖。

@Lfan-ke
Lfan-ke force-pushed the apps-starry-cpu-subtitle-test branch from 260476f to 24f3716 Compare August 6, 2026 15:48

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

本 PR 新增 apps/starry/cpu-subtitle-test,提供 SRT/WebVTT/ASS 的静态 C 解析与结构性 golden,并覆盖四个架构的构建/QEMU 配置。它属于局部、低风险的 StarryOS 操作者工作流;未改变 StarryOS syscall/Linux ABI,syscall 准则不适用。应用置于 apps/starry,与语义测试套的边界一致。

阻塞项

唯一阻塞项见行内评论:real-assets cell 在任一真实素材缺失时仍可成功,导致声明的一个字幕格式未被验证而整体 runner 仍打印 TEST PASSED。请使两个由 prebuild 承诺 stage 的素材都成为必需项,并增加“分别缺 SRT/ASS 必须失败”的回归覆盖。

验证与 CI

  • review_pr_helper.py test、head/base 校验、git diff --check origin/dev...HEADbash -n prebuild.shsh -n run_all.shpython3 -m py_compile tools/gen_goldens.py 通过。
  • 四个声明架构的 host musl cross-compile 与两个素材的 staging 均通过;x86_64 overlay 的 run_all.sh 在完整素材下为 5/5 并输出 TEST PASSED
  • 对当前 head 编译 real-assets cell 后,单独保留 SRT 时输出 OK 10 并以 0 退出,单独保留 ASS 时输出 OK 14 并以 0 退出,确认该缺陷可复现。
  • 已按 README 实跑 cargo xtask starry app qemu -t cpu-subtitle-test --arch x86_64:rootfs 获取、submodule 素材、prebuild、overlay 注入和 StarryOS 构建均完成;QEMU 在 guest 启动前报 Error loading uncompressed kernel without PVH ELF Note。基线 cpu-concurrency 的同一 x86 配置也使用相同的 uefi = false/to_bin = false 路径,因此该 host/QEMU PVH 问题未归因于本 app,且未作为此次阻塞项。
  • 当前组织 CI 为 1 个成功、4 个预期跳过、1 个取消;没有检查实际证明本新增 app 的运行路径。取消的 changed-path 检查未提供本 app 的失败证据。

既有讨论、重叠与审计

已重新检查三条历史请求修改:README 现已提供四个运行命令,且 prebuild 已改为宿主 cross compiler,这两项旧问题已解决;上一轮关于素材缺失的意见在当前 head 仍成立,即本次唯一阻塞项。base 中未找到等价 subtitle/SRT/VTT/ASS 实现;以 subtitlecpu-subtitle-testapps/starry 检索开放 PR 后,未发现重复、依赖或冲突实现。除上述素材失败传播问题外,parser、资源路径、runner 的退出码/regex 传播、配置及四架构预构建均已审查,没有额外阻塞项。

Powered by gpt-5.6-terra

} else { gate_check(&g, 0, "srt parse failed (malformed cue)"); }
free(sbuf);
} else {
fprintf(stderr, " SKIP: tashouheng.srt absent under %s\n", sub_dir());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

严重性:阻塞。这里仅用 have_any 判断“至少一个素材存在”,因此 tashouheng.srtbadapple.ass 任一缺失时只会打印 SKIP;另一个素材存在便会让该 cell 以 0 退出,run_all.sh 仍可能输出 TEST PASSED。这会静默丢掉一个格式的真实素材断言,与第 7 行“两个素材均由 prebuild stage 且缺失即失败”的契约不一致。已本地编译当前 head 验证:只保留 SRT 时输出 OK 10 并退出 0,只保留 ASS 时输出 OK 14 并退出 0。请分别校验两个素材,任一缺失都应使 gate 失败,而不是以“至少一个存在”替代完整覆盖。

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

本 PR 新增 apps/starry/cpu-subtitle-test:在四个架构上构建并运行 SRT/WebVTT/ASS 解析、时间戳转换和结构 golden 的 StarryOS 应用。改动局限于应用、脚本、QEMU 配置和资源子模块,没有修改 StarryOS 内核 syscall/Linux ABI;不过解析器的动态内存路径会影响该应用在资源受限 guest 中的可靠性。

阻塞问题

存在 1 个需修复的内存分配失败路径,已附在 subtitle_common.h 的新增行评论中。

既有讨论与覆盖

先前关于 qemu-user 内运行 guest GCC 的 cc1: posix_spawn 问题已通过当前 head 改为宿主 musl cross compiler/zig 路径解决;README 现已给出资源子模块初始化和四架构 QEMU 命令,旧的文档缺失问题也已解决。base 中未发现已有 subtitle 实现;以 subtitle/SRT/WebVTT/ASS 检索的开放 PR 没有发现重叠或依赖。

CI 与本地验证

当前 head 的组织 CI 中格式化、clippy、x86_64 Starry QEMU 等相关 job 成功;矩阵有按 runner 分流的 skipped/cancelled job。唯一失败的是未触及 surface 的 Test axvisor aarch64 qemu (smoke + axtest + timer stress) / run_host,因此从变更范围看不由本 PR 引起(该 job 日志接口未能解码返回)。CI 未显示此新增 app 的 cpu-subtitle-test carpet 实际被选择执行。

本地 cargo fmt --checkgit diff --checkbash -n prebuild.shsh -n run_all.shpython3 -m py_compile tools/gen_goldens.py 通过。helper 的 changed-files/rust-plan 已运行;其保守的全 workspace cargo clippy --all-features -- -D warnings 在未改动的 ax-cpu feature 组合因 LinuxCurrent/kernel TLS 互斥而停止,和当前 head CI 的 clippy 成功不一致。主机静态编译并运行四个无资源 cell 成功;真实资产 cell 因 workspace 未初始化的子模块内容无法执行,故未把该结果当作应用 QEMU 验证。

修复该 OOM 路径并完成当前 head 的 app runtime 覆盖后可重新审核。

Powered by gpt-5.6-terra

static cue *track_push(track *t) {
if (t->n == t->cap) {
t->cap = t->cap ? t->cap * 2 : 64;
t->c = (cue *)realloc(t->c, (size_t)t->cap * sizeof(cue));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

严重性:阻塞。realloc 的返回值在这里直接写回 t->c,但没有处理 NULL;当字幕 cue 足够多或 guest 内存不足时会丢失旧分配并立即解引用空指针,导致 carpet 崩溃而不是报告可诊断的失败。请用临时指针检查分配结果,并让 track_push/解析器把 OOM 作为普通失败传播。

@Lfan-ke
Lfan-ke force-pushed the apps-starry-cpu-subtitle-test branch 3 times, most recently from 9dbd184 to a63a981 Compare August 12, 2026 22:52
Subtitle carpet (C-side, pure CPU). Self-written SRT/VTT/ASS parsers (libc-only, static);
every assertion is exact-millisecond timestamp / cue-structure / encoding against a
deterministic golden - no smoke. Assertions cover counts/timestamps/index-order/style/
encoding only; no subtitle dialogue text is embedded or reproduced.

Cells (three-gate fail==0 && total==EXPECTED==pass, mutation-tested):
- subtitle_srt (32): SubRip parser on synthetic authored cues - HH:MM:SS,mmm parsed to
  exact ms (00:00:01,000->1000, 01:02:03,456->3723456), cue count, index 1..N, monotonic
  non-overlap, multi-line join, BOM/CRLF/trailing-blank/empty-text edge cases.
- subtitle_ass (27): Advanced SubStation Alpha - [Script Info]/[V4+ Styles]/[Events],
  Format-column-order-driven mapping, H:MM:SS.cc centisecond->ms, style table
  (Name/Fontname/Fontsize/PrimaryColour &HAABBGGRR), override-tag {\..} stripping to length.
- subtitle_vtt (16): WebVTT - WEBVTT header enforced, HH:MM:SS.mmm + MM:SS.mmm, cue
  settings/identifier, NOTE comment skipping.
- subtitle_convert (9): SRT<->VTT round-trip preserves timestamps exactly (comma vs dot
  separator), plus a real ffmpeg srt->vtt structural cross-check.
- subtitle_realassets (24): the real .srt/.ass assert STRUCTURE only - cue/dialogue count,
  first/last timestamp, monotonicity, well-formed UTF-8 (self-written RFC-3629 validator)
  vs a structural golden. Hard-fail if the media submodule (ASSET_DIR) is absent.

Cells 1-4 are fully deterministic (cues authored in-code). Test subtitle files live in a
git submodule (Lfan-ke/hw4os-s5d1t2 media branch, git-LFS) via ASSET_DIR; only carpet code
+ structural goldens are committed here. Compiles clean under -Wall -Wextra -static.

Signed-off-by: 林晨/禾可 <chengkelfan@qq.com>
Signed-off-by: Leo Cheng <chengkelfan@qq.com>
@Lfan-ke
Lfan-ke force-pushed the apps-starry-cpu-subtitle-test branch from a63a981 to 9a9e717 Compare August 12, 2026 23:27

@mai-team-app mai-team-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

本 PR 新增 apps/starry/cpu-subtitle-test,为 SRT、WebVTT、ASS 的解析和 SRT/VTT 时间转换加入五个静态 C cell、四套 build/QEMU 配置及资源 staging。它不改动 StarryOS syscall/Linux ABI;功能开发准则按新增、面向操作者的 Starry app 工作流适用,当前改动与现有内核接口隔离。

未解决问题

下方行内评论是阻塞项:共享时间戳解析器会把带额外 : 的非法 SRT/VTT 时间戳成功解析成另一个时间,导致损坏输入静默产生错误 cue 位置。请限制字段数,并在 SRT、VTT 两个 cell 中加入会失败的回归覆盖。

已检查与验证

  • prepare-review 已确认本地 HEAD 为 9a9e717fb3105e5b1687c0cf8e5d15ea13fc037egit diff --check origin/dev...HEAD 通过。
  • bash -n apps/starry/cpu-subtitle-test/prebuild.shsh -n programs/run_all.sh、TOML 解析及 python3 -m py_compile tools/gen_goldens.py 通过。
  • 使用 cc -std=c11 -O2 -static -Wno-unused-function 编译 cell;SRT、VTT、转换和 ASS 的合成用例分别输出 OK 32/16/9/27。未初始化 submodule 时 real-assets cell 如预期失败,未将资源缺失伪装为通过。
  • 直接探针复现了该问题:01:02:03:04,005 返回成功及 3724005ms

CI、既有讨论与重叠

当前 head 的组织 check 汇总为 70 个已完成项(26 success、35 skipped、8 cancelled、1 failure);格式化和 clippy 为成功。该一个失败的详细归因未能从当前 REST 摘要取得,因此不将其作为本次行内问题的依据;无论如何,本阻塞项可本地确定复现。既有关于 qemu-user 编译、资源 gate 和运行文档的评论均已由当前 head 的 host cross-compile、资源硬失败和 README 运行命令解决;其余旧 review 均针对较早提交。基线和开放 PR 检索未发现等价 subtitle 实现或实质重叠,新增 app 的位置与基线 apps/starry/cpu-concurrency 模式一致。

除上述解析正确性和相应回归测试缺口外,未发现其他待解决问题。

Powered by gpt-5.6-terra

/* read up to three colon-separated integer fields, then the fractional part */
while (*p) {
if (*p >= '0' && *p <= '9') { cur = cur * 10 + (*p - '0'); digits++; p++; }
else if (*p == ':') { if (nf >= 3) return -1; fields[nf++] = (int)cur; cur = 0; digits = 0; p++; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

严重性:阻塞。这里允许第三个 :,随后在 nf >= 2 分支只使用 fields[0]fields[1] 和最后一段,导致中间段被静默丢弃。实测 01:02:03:04,005 被成功解析为 3724005ms(相当于 01:02:04,005),而不是作为非法 SRT/VTT 时间戳失败;损坏的字幕会被定位到错误时间。请将允许的冒号数限制为两段时间分隔,并分别加入 SRT 与 VTT 的拒绝回归用例。

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