🟡 [M23] 小文件 single_frame_tail 与 head 重叠导致 render 数据误导 #42
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
小文件(total ≤ 35 行)时,
bench_single_frame中tail位置total.saturating_sub(35)为 0,与head完全重叠,产生标记不同但数据相同的 benchmark 结果。此外
total在 36~104 行时,head/tail/middle 帧之间存在大量重叠区域,total=70时 middle 与 tail 完全重叠。根因
crates/bench/src/suites/render.rs硬编码三个位置:middle = total/2在小文件时偏向 tail;阈值仅检查total > 0,未验证帧间不重叠。修复
FRAME_LINES = 35至suites/mod.rsselect_frame_positions(total)helper:total < 3 * FRAME_LINES时只返回 headtotal >= 3 * FRAME_LINES时返回三帧,middle 居中于 head-end 与 tail-start 之间bench_reverse_scan在total <= FRAME_LINES时返回空结果PR
Fixes in PR #46 (
fix/m23-single-frame-tail-overlap)变更文件
crates/bench/src/suites/mod.rsFRAME_LINEScrates/bench/src/suites/render.rsselect_frame_positions()helper, 重写bench_single_frame, +9 testscrates/bench/src/suites/jump.rsbench_reverse_scan小文件保护