Files
R8Forge/TODO.md
T
dsh cc75ed7ea4 drop the CI pipeline, keep the local ctest
The act_runner image has no cmake and installing it per run did not get through
this network (even from a domestic mirror), so the pipeline was cost without a
green run.  Remove .gitea/workflows/ci.yml and the image recipe, keep what was
useful on its own:

  * ctest --test-dir build -j 4   runs the 8 checks in about 9 s
  * README / AGENTS now point at that instead of six commands typed by hand

TODO keeps a note: CI is paused, and ROT-8-viz is still the untested half.
2026-11-11 10:07:44 +08:00

3.1 KiB
Raw Blame History

TODO

"还没做"的事都收在这一个文件里,别散在 README/AGENTS/docs 中。每条写清楚为什么值得做和 从哪开始;做完就删掉(历史在 git log 里)。SPEC.md §12 那张"已经确认走不通"的表是 结论,不是待办,别混进来。

交互式计算

  • 桌上计算器(examples/calc.r8asm):输入 12+34= 输出 46,支持 + - * /。 条件已经齐了:inp 在三个 VM 里都有实现、tape_run/derive 能用 -i 脚本化喂输入、 例程头部能声明 ; in ...;数字用 clb_undigits 攒、回打用 clb_digits、 四则用 clb_add_nc / clb_mul / clb_divmod(都穷举验证过)。 要设计的是字符分派:'0'..'9'(0x30..0x39)bit4 是 1,'*' '+' '-' '/' (0x2A..0x2F)bit4 是 0 —— 一次 ror + biz 就能分开;运算符再按 t = C - 0x2A 的小整数链式比较。先写 drv/calc_lex.r8asm 单点验证分派,再拼整机。

工具

  • r8forge --opt:纸带级窥孔优化(收益面最大):><、<>、--、11 个 ++、 重复清位…… 要能重算跳转偏移。配套 r8forge_tape_diff(比较两条纸带的 OUT 流和步数) 证明等价 —— 一次改动全库受益。
  • --profile:统计每段宏/每个 cell 的步数占比和 .tp 行走距离,用数据决定下一步优化谁 (现在".tp 行走占七成"还是估的)。
  • %synth --verify:把 .r8forge_cache/ 里每条结果按对应表的所有输入重跑一遍, 给"缓存已入库"兜底 —— 一条坏条目会让每次构建静默用错块。
  • CI:暂时不做。本地的 ctest --test-dir build -j 4 已经接好(8 条,9 秒),但 act_runner 的 镜像里没有 cmake,装包(哪怕换了国内源)也跑不通,先本地跑。 ROT-8-viz 仍然零测试:串行默认 / -n / 几何 / 7E1 全靠手测,而它是权威虚拟机 —— 哪天要补测试,先补它。
  • src/r8asm.cc:154 有个上游留下的 // TODO: FILL THE BLANK(ROT8_NODE 宏的 children 是空的)。那是继承来的实现,先记着,别顺手改。

文本与画面

  • clb_puts + 迷你 printf:现在只能一个 cell 一个字符地打,缺"把一段 cell 当字符串 打出来"和 %d/%c/%s 的格式化,例程就能打印整句话而不是光秃秃的数字。
  • 把 259 格当帧缓冲:串行下 \r(0x0D)能原地重绘,1 bit/cell 的 16×16 位图或 8×8 生命游戏都能塞进纸带,rot8_test --live 里直接看它动。

想清楚但没做的优化

  • clb_divmod 预计算 ~D:单轮 2019 → 973 步,估计 28.6k → 17.6k 步,纸带净 −76; 没换是因为当时指名用 raw_sub。细节和注意事项见 docs/divmod.md 第 6 节。
  • clb_digits 的布局:13 格草稿跨得很开,.tp 行走占了纸带的大头;重排草稿格应该能 明显缩短(未实测)。
  • clb_divmod 里那个 495 字符的提交 copy:还是全展开的,可以想压缩的办法。