mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-11 04:00:38 +00:00
fix(code-runtime-python): make the float encoder context-independent; correct the binding-reply README entry
The review's critical: Decimal(repr(value)).normalize() read the process-global decimal context, so a legitimate program setting getcontext().prec = 2 silently rounded the completion value's digits and traps[Inexact] = True made the encode raise, misclassifying a successful run as an exception. A fixed module-level Context(prec=28) makes the spelling decision context-independent; a regression case mutates both context knobs and asserts the float round-trips exactly. The binding-reply README entry now states the fact (no seam-level cap; maxValueBytes meters only the done frame; a wide reply is rebuilt and encoded whole, bounded by process memory), matching the earlier reviewer wording.
This commit is contained in:
@@ -113,7 +113,7 @@ kind: "package-reference"
|
||||
- **跨语言 guard 覆盖执行的表面与帧字段形状,而非字段类型**——mirror e2e 比较必填/可选字段集,而非 `cpuSeconds` 在两侧是否都是 `int`;类型级漂移由评审加后端的真实子进程套件捕获。
|
||||
- **以 `setsid()` 逃出子进程组后代不被组拆卸回收**——`kill(-pid)` 够不到它;运行仍按 done 帧决定的值结算,若该孤儿持有管道,close 截止兜底会强制结算,但孤儿本身在自行退出前一直存活到 fiber 之外。
|
||||
- **结算后到达的 `log` 帧被丢弃**——运行一旦结算,宿主侧捕获即关闭;迟到的 fd-3 `log` 帧(来自比 done 帧存活更久的线程)会被丢弃,而不是追加到 `logs`。
|
||||
- **binding 值的宿主侧内存界是帧解析上限,而非 seam 预算**——binding 回复的值在宿主侧重建并按 `maxValueBytes` 计费;中间 binding 值没有 seam 级字节上限,受无损 JSON 序列化成本与进程内存约束(见 binding 实参条目)。
|
||||
- **binding 回复值没有 seam 级字节或深度上限**——`maxValueBytes` 只计量 done 帧的完成值;宽 binding 回复在宿主侧重建(`snapshotJsonValue` 遍历)并整帧编码,两侧都只受进程内存约束(与没有子进程侧预算的 binding 实参一样)。
|
||||
- **`run()` 是一次性的**——`logs` 只有在 `CodeRunResult` resolve 后才能获得;没有为运行中程序产生的输出提供流式日志或进度接口。
|
||||
- **运行之间不保留状态**——每次请求都在全新子进程中执行;持久 REPL 风格内核在某个后端带来自己的日志方案之前保持延期。
|
||||
- **原始长度超过 64 MiB 的 fd-3 帧会让本次运行以 worker-exit 结算**——`maxLogBytes`/`maxValueBytes` 在加载期被限制到同一解析器上限,因此诚实子进程的帧总能放得下;模型构造的超过 64 MiB 的 binding 实参(一个在 seam 层没有预算的值)会触发同一上限——这是该 OOM 防护的已接受残余。
|
||||
|
||||
Reference in New Issue
Block a user