Skip to content

SCAPI Skyline Project v0.1.57

Choose a tag to compare

@DionysusDWI DionysusDWI released this 27 Sep 12:18
· 134 commits to main since this release

SCAPI Skyline Project v0.1.57

壳存档的增量(追加)写 + 墓碑删除 + 压缩重写 —— v0.1.53 的存档每次重写整个文件
(4096 个壳 = 64 MiB),而壳是边玩边攒的;本版把它改成增量。

  • 追加写:只把"脏立方体"追加到文件末尾;读档侧天然支持 —— 按顺序读、后面的记录覆盖前面的。
  • 墓碑:被淘汰/忘记的立方体写一条全零壳当删除标记(记录长度不变,仍是 16,396 B)。
  • 压缩重写:只有"要改的记录数 ×2 ≥ max(64, 已有记录数)"(改动过半)时才全量重写(.tmp + 安全换名)。
  • 桥:skyline.CubeShellForget(写墓碑删除)、CubeShellEvictTo(淘汰到 N 个触发压缩)。
分支 结果
墓碑追加 appendMode=true、appendedRecords=1、appendedBytes=16,396、tombstonesWritten=1、compactRewrites=0、lastSaveMs=0.16 ms;文件 1,082,148 → 1,098,544 B(+16,396,没有重写)
重启读档 67 条 → tombstonesLoaded=1、loadedRecordsTotal=66(那个立方体确实被删);重新采到它后摘要回到 78508bcaec7e1fd5(与忘记前逐位相同) → 墓碑+重采往返逐字节无损
压缩重写 CubeShellEvictTo(30) 淘汰 36 个(53%)→ appendMode=false、compactRewrites=1、fileRecords 68 → 30、fileBytes=491,892 B、lastSaveMs=1.82 ms

如实记的边界:①文件会先长到约 1.5× 活跃集才压缩;②淘汰是永久的(LRU),
被淘汰的立方体只在区块再次 Valid 时才会重采(实测淘汰到 30 后视距 128→64→128 → harvestedOnValid=19、壳仓回到 66,
但集合不完全相同,摘要随之为 ea8fa46a0a713d37,预期行为);③追加不是原子提交,被打断时读档读到哪算哪。
下一步:Iris 光影接入面;新目标 2 的加载/卸载响应继续调参;回归清单加 CubeShellPersistence 新字段。
证据:data/sessions/skyline-v0157/、notes/132。构建:Release,0 警告 0 错误。
源码包内含本版补丁 height-v0157.patch、全部历史补丁与 agentbridge/ 源码。


[v0.1.57] - 2026-09-28

第六十七个版本:壳存档的增量(追加)写 + 墓碑删除 + 压缩重写(新目标 2/3.2 的规模上限所在)。

本版相对 v0.1.56 的变更:

类别 内容
追加写 v0.1.53 的存档每次重写整个文件(4096 个壳 = 64 MiB)→ 本版只把"脏立方体"追加到文件末尾;读档侧天然支持:按顺序读、后面的记录覆盖前面的
墓碑 被淘汰/忘记的立方体写一条全零壳(CubeSurface32.IsEmpty)当删除标记 —— 记录长度不变(16,396 B),读档时删除该立方体
压缩重写 只有"要改的记录数 × 2 ≥ max(64, 已有记录数)"(改动过半)时才全量重写:.tmp + MoveFileSafely 换名
头计数 追加时更新偏移 8 的记录总数;脏集/墓碑由主线程维护(采集/淘汰/清空三条路径)
桥 skyline.CubeShellForget(cx,cy,cz)(取证:写墓碑删除)、CubeShellEvictTo(n)(取证:淘汰到 N 个触发压缩)

Verified(AgentLab,三个分支都走到)

分支 结果
墓碑追加 appendMode=true、appendedRecords=1、appendedBytes=16,396(正好一条)、tombstonesWritten=1、compactRewrites=0、lastSaveMs=**0.16 ms**;文件 1,082,148 → 1,098,544 B(+16,396,没有重写)
重启读档 67 条记录 → tombstonesLoaded=1、loadedRecordsTotal=66 → 那个立方体确实被删掉;重新采到它之后摘要回到 78508bcaec7e1fd5(与忘记前逐位相同) → 墓碑+重采往返逐字节无损
压缩重写 CubeShellEvictTo(30) 淘汰 36 个(= 68 条的 53%)→ appendMode=false、compactRewrites=1、fileRecords 68 → 30、fileBytes=491,892 B(= 12+30×16,396)、lastSaveMs=**1.82 ms**

如实记的边界:①文件会先长到约 1.5× 活跃集才压缩(阈值=改动过半);②淘汰是永久的(LRU),
被淘汰的立方体只在区块再次 Valid时才会重采(实测淘汰到 30 后做一次视距 128→64→128 → harvestedOnValid=19、壳仓回到 66,
但集合不完全相同:摘要 78508bcaec7e1fd5 → ea8fa46a0a713d37,预期行为);③追加不是原子提交,
写到一半被打断时读档读到哪算哪。
下一步:Iris 光影接入面;新目标 2 的加载/卸载响应继续调参;回归清单加 CubeShellPersistence 新字段。
证据:data/sessions/skyline-v0157/、notes/132。构建:Survivalcraft.Windows Release,0 警告 0 错误。

Relative to v0.1.56: incremental shell saving. Since v0.1.53 every save rewrote the whole file, sixty four mebibytes at the four thousand and ninety six shell cap, so now only dirty cubes are appended and the loader already handles that since later records override earlier ones. Evicted or forgotten cubes become zero shell tombstones of the same record length and remove the cube on load, and a full rewrite only happens once more than half the records change. Two evidence bridges were added, CubeShellForget and CubeShellEvictTo. Measured: a tombstone append added exactly one record of sixteen thousand three hundred and ninety six bytes with zero rewrites in 0.16 milliseconds, the restart read sixty seven records as sixty six cubes with one tombstone applied so the cube really was removed, and re-harvesting it returned the store digest to exactly its previous value, showing the round trip is lossless. Compaction triggered after evicting down to thirty cubes, which changed fifty three percent of records, rewriting sixty eight records down to thirty in 1.82 milliseconds. Recorded boundaries: the file can grow to about one and a half times the live set before compaction, eviction is permanent until those chunks reach Valid again, and appends are not atomic. Still open: the Iris groundwork and load and unload response tuning. Gates CheckChunkAddressing 2816/0 and CubeInvariantsCheck 4096 4122/0; Release build 0 warnings 0 errors