Skip to content

[PR] fix(preflight): measure the image payload after folds - #4932

Closed
ReineLan wants to merge 17 commits into
ranxianglei:masterfrom
ReineLan:2026-10-27_image-preflight-budget
Closed

ReineLan wants to merge 17 commits into
ranxianglei:masterfrom
ReineLan:2026-10-27_image-preflight-budget

Conversation

@ReineLan

Copy link
Copy Markdown
Contributor

(ai: openai/gpt-6)

An image-removing compression block can be declared futile from text savings alone, then still be charged the original image reserve after rebuilding. Measure the current rendered image payload, account for image-removing candidates before a futility verdict, and use rebuilt image cost for fit, anchors, diagnostics and floors. Rounds remain bounded and actual rebuilt fit decides the result.

After actual folding/image reduction, a pixel-billed wire with fitting text can request fresh upstream billing arbitration; an explicit overflow arm still refuses. Regression controls cover complete historical-image removal, two protected live images, overflow refusal, unusable-summary baseline preservation and byte-exact archived-image retrieval. Refs #4120. This repairs the immutable-image/futility mechanism; it does not claim every image-related incident is closed.

Stack dependency: #4770 must land first. This branch contains its exact current ancestry plus the budget repair. After #4770 is merged, synchronize this branch to remove the prerequisite diff. No force-push or replacement of the existing contribution is required. The native-checkpoint and zero-fold-calibration changes are separate PRs.

Validation on tested source tree ad521e4, synchronized with upstream e4cc685: typecheck, build and 31 targeted cases pass, zero skips. Head 3de24c0 adds exact #4770 ancestry with a byte-identical Git tree. Earlier combined validation passed 157 regression cases; a synthetic real Codex/provider run reduced per-request input from 33576 to 17067 while preserving its memory code and image conclusion. Those are earlier integrated checks, not a production-recovery claim. Full CI remains pending. No kernel/configuration/version changes.

ReineLan and others added 12 commits October 26, 2026 02:53
Retain exact source-part ownership when surviving cores are reminted or split by a summary. Cover partial folds, raw resends, short-view recovery, genuinely new identical images, cold loading, and byte-exact archived-image retrieval.
Retain exact source-part ownership when surviving cores are reminted or split by a summary. Cover partial folds, raw resends, short-view recovery, genuinely new identical images, cold loading, and byte-exact archived-image retrieval.
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复。 本 PR 与 #4120 同属「图片撞窗 → preflight 拒发」家族,但不是重复条目:#4120 是用户报障(当时 triage 结论为「图片不可折叠 + codex 窗口对齐,非代码缺陷」),本 PR 是针对其中机制层缺陷的修复——responses 车道上折叠会把归档图片移出出站 wire,而旧的 futility 判定只数文本节省、rebuild 后的 anchor/floor/校准尺寸仍按原始 imageReserve 计费(#1843/#488 时期写死的 "Folding never removes them" 假设在该车道不成立)。与在途的 #4770 是栈依赖关系而非重复(#4770 = 压缩块 parts 跨 rebuild 保留;本 PR = 图片预算计量)。相邻的 #4124(按 prompt 限图片张数)、#3909(每轮重发大 body)机制不同,不并入。

标签:bug codex scope/wiring p2(机制缺陷:大图 + 窗口压力会话被 futile 误判拒发,有绕行故 p2;主战场 preflight 判定面 = wiring;证据车道为 codex/responses)。

当前状态核对(已拉分支实测 git 拓扑,未只看描述):

正在做完整 review(方向关 + 代码关 + 测试有效性),结构化八问结论稍后在本帖跟进。

ci-check added 2 commits October 27, 2026 15:15
…udget repair

The budget repair replaced PreflightDeps.imageReserve's ranxianglei#1843 doc comment with a one-liner, dropping the load-bearing rationale for the limit-minus-reserve text-channel algebra and the conservative total-view direction. Restored it and recorded the new initial-view semantics introduced by measureImageReserve. Review-side fix, no behavior change.
@ranxianglei

Copy link
Copy Markdown
Owner

(ai: vllm-qwen/qwen3.8-27b)

Merged origin/master (09a5b5b) into this branch — clean, no conflicts (master touched no lines inside the PR's changed regions); typecheck green and the PR's four test files pass (28/28) on the merged tree. Pushed as 346c816; PR is no longer behind, all 25 checks queued.

@ranxianglei

Copy link
Copy Markdown
Owner

(ai: vllm-qwen/qwen3.8-27b)

Re-synced origin/master (30ec63b) into this branch on top of the earlier ci-fixes sync — clean merge, no conflicts (master's only touches in shared files sit outside this PR's image-budget regions); typecheck green and the PR's four test files pass (28/28) on the merged tree. Pushed as 071d05f; PR is up to date with master and checks are running.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 进度汇报(CI 工程师,auto-fix lane 1/3):会话曾因大仓 checkout 长时间无输出被强制重启一次,现已恢复,工作未丢。

已完成的状态核对(全部为本次运行内的实时取证):

正在做:把 origin/master(c26c31ace,与 ci-fixes 同点)merge 进 PR head,逐文件解冲突,随后推送并跑定向验证。完成后给出完整八问结论。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[ework] auto-fix stalled: test (ubuntu-latest, 24, 3), test (ubuntu-latest, 22, 3), test (windows-latest, 22, 1), test (ubuntu-latest, 22, 2), test (windows-latest, 22, 4), test (windows-latest, 22, 2), test (ubuntu-latest, 24, 2) — stopping for human review

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[ework] auto-fix stalled: test (ubuntu-latest, 24, 3), test (ubuntu-latest, 22, 3), test (windows-latest, 22, 1), test (ubuntu-latest, 22, 2), test (windows-latest, 22, 4), test (windows-latest, 22, 2), test (ubuntu-latest, 24, 2) — stopping for human review

@ranxianglei

Copy link
Copy Markdown
Owner

Landed via batch PR #6464 (merged) — closing as superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working codex p2 scope/wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants