Abstract

Kimi K3 submitted PR #220979 to LLVM over one long session. After the review arrived, K3 proposed three revisions in the original session, none of which adopted it; GPT-5.6 Sol, however, handling the same task in a new session, produced on its first attempt a revision logically equivalent to the final merged version. This contrast may stem either from a gap in model capability or from the context of the original session. To separate the two, I truncated the original session at the decision point where K3 received the review, applied single-variable edits to the transcript (removing the auto-compaction, adding the function's code, replacing one sentence of the compaction summary, removing past thinking from the history, replacing the task description, and appending the review intent to the end of the resume message), and resampled repeatedly from the same decision point: 11 K3 conditions with 41 valid runs, plus two GPT-5.6 Sol conditions with 5 runs each, with each condition's prediction written down before it ran. Without history, K3 folded the check into the existing loop 5/5 times, whereas resumed unedited it did so only 1/5; removing the auto-compaction gave 3/5; adding the function's code (0/3), replacing the summary's problem-framing sentence (1/3), and replacing the task description (0/3) brought no improvement; appending one complete sentence of review intent gave 3/3, as did its first or second half given alone; by contrast, only reminding K3 to reread the review gave 0/3. Sol went 5/5 in the fresh condition, and likewise 5/5 when resuming the same compacted K3 history (with K3's system prompt and thinking removed); K3 itself, resuming this history with its thinking removed, went 3/5. The results indicate that the failure in the original session cannot be put down simply to a lack of capability or to missing information, and that one unambiguous statement of intent is enough to change K3's choice; the reasoning transcripts suggest that the failures arise mainly in how K3, carrying history, interprets and weighs the review.

1. Introduction

An assertion failure in LLVM's register coalescer (RegisterCoalescer) was reproduced, localized, and fixed by Kimi K3 over one long session, and the patch was submitted as PR #220979. The reviewer asked that, instead of adding a separate scan, the existing check be extended (quoted in Section 2.2). However, the three revisions K3 proposed in the original session all remained separate scans, and none was adopted; when I gave the same task to GPT-5.6 Sol in a new session, Sol produced, on its first attempt, a revision logically equivalent to the final merged version.

The most direct explanation is a capability gap between the two models. This post tests an alternative explanation: K3 is capable of applying the review, but the context of the original session prevented it from doing so; if this holds, the further question is which part of the context is responsible. The method follows Anthropic's alignment assessment of cybersecurity incidents (An alignment assessment of recent cybersecurity incidents): locate the key decision point in the incident transcript, implement each hypothesis as one concrete transcript edit, resample from the decision point and compare behavior rates, and do not rely on the model's explanations of its own behavior.

The division of work is as follows. K3 wrote the patch, and the merged revision came from Sol. I set the research question, the experimental conditions, and each condition's prediction, and I also introduced the three turns the experiment took. First, H-a rested on the premise that "K3 cannot see the pre-check loop when deciding"; when I went back through the original session, I found that before compaction K3 had not only read this loop but had also used it as the precedent for writing a separate scan, so the information-gap hypothesis does not hold (Section 4.3). Second, after the weak cues failed, I did not continue dissecting the context but switched directly to an explicit statement of intent, which brought K3 with history from 1/5 back to 3/3 (Section 4.5). Third, I questioned the keyword excerpts on which the analysis rested and found that they covered only about 6% of the text; after the full text was read, the conclusion that "10 of the 14 failures clearly found the correct approach" was corrected into three groups (Section 5.1). Claude helped write the run scripts, run the experiments, and organize the analysis; its lapses during the analysis are listed in Appendix B.

The main contributions of this post are:

  • Separating the effects of capability and context in a real coding agent failure. Following the reference study, the original session is truncated at the decision point, single-variable transcript edits are applied, and the session is resampled (Section 3): the same K3 went 5/5 without history and 1/5 when resumed unedited with history; one explicit sentence of review intent was enough to restore folding (9/9 pooled), whereas only a reminder to rethink gave 0/3 (Section 4).
  • A run-by-run reading of the failed runs' reasoning transcripts: the failures did not stem from misreading the code but fall into three groups, namely decision failures, no workable way found, and misread review intent; runs without history met the same obstacles but treated the first sentence of the review as a hard constraint (Section 5).
  • Two testable harness design suggestions, and a reusable eval case built from this decision point (Section 7).

2. Background

In brief, the first patch added a new loop to fix the bug, and the reviewer considered that extending a loop already in the function would cover the same case. The rest of this section gives technical details for compiler readers.

2.1 The bug

Since f44079d, x86 instruction selection can emit sub-register writes of the form %27.sub_8bit = MOV8rm .... The write carries no undef flag, so it implicitly reads the old value of the whole register in order to preserve the remaining bits.

To delete a COPY, RegisterCoalescer::removeCopyByCommutingDef commutes the preceding OR, rewrites the explicit operands, and then removes the old definition from the live interval. The partial def, however, is still implicitly reading that old value, so when coalescing is retried, JoinVals::analyzeValue asserts: Instruction is reading nonexistent value.

The function already contains a pre-check loop that runs before commuting (around line 922). It iterates use_nodbg_operands and gives up on commuting if it finds a use that reads the current value number AValNo and is tied to a def. A partial def is a def operand, so it lies outside the scope of that loop.

2.2 The first patch, the review, and the merged version

The first patch added a new loop dedicated to scanning defs:

for (const MachineOperand &DefMO : MRI->def_operands(IntA.reg())) {
  if (!DefMO.getSubReg() || DefMO.isUndef())
    continue;
  SlotIndex ReadIdx =
      LIS->getInstructionIndex(*DefMO.getParent()).getRegSlot();
  if (IntA.Query(ReadIdx).valueIn() == AValNo)
    return {false, false};
}

The reviewer, arsenm, left the following comment on this new loop:

I don't think you should need a new scan over defs. Most code should be checking readsReg, not getSubReg / isUndef directly.

MachineOperand::readsReg() is defined as !isUndef() && !isInternalRead() && (isUse() || getSubReg()), so a sub-register def without undef itself counts as a read. The merged version therefore no longer scans defs separately and instead widens the existing pre-check loop to all operands:

  for (MachineOperand &MO : MRI->use_nodbg_operands(IntA.reg())) {
  // Make sure all reads of AValNo can be rewritten to the new register.
  for (MachineOperand &MO : MRI->reg_nodbg_operands(IntA.reg())) {
    if (!MO.readsReg())
      continue;
    ...
    if (UseMI->isRegTiedToDefOperand(OpNo))
    // Partial defs and tied uses can't be rewritten independently.
    if (MO.isDef() || UseMI->isRegTiedToDefOperand(OpNo))
      return {false, false};

The two sentences of the review correspond to these two changes: the first asks that no scan be added, and the second asks that readsReg() replace the hand-written getSubReg() / isUndef() checks.

2.3 Configuration of the original session

The original session ran on Kimi Work's k3-agent, with a 256k context window. At about 210k tokens it triggered auto-compaction, which condensed several hundred messages into a handoff summary; the first patch was written after compaction, and the review arrived after that.

3. Methods

Figure 1 summarizes the experimental design.

Diagram of the experimental design: the original session timeline runs through reproduce and locate, auto-compaction, first patch, and review fetched; the session is truncated at the decision point after the review is fetched, and either a single-variable edit is applied (baseline, no-compaction, no-thinking, reframe, H-a, task-prompt, and four appended sentences) or Sol continues the K3 history, then it is resampled; the fresh control receives only the task description in a new session, once for K3 and once for Sol; all conditions are measured with the same measures: folding, blind grade, and MIR tests. Diagram of the experimental design: the original session timeline runs through reproduce and locate, auto-compaction, first patch, and review fetched; the session is truncated at the decision point after the review is fetched, and either a single-variable edit is applied (baseline, no-compaction, no-thinking, reframe, H-a, task-prompt, and four appended sentences) or Sol continues the K3 history, then it is resampled; the fresh control receives only the task description in a new session, once for K3 and once for Sol; all conditions are measured with the same measures: folding, blind grade, and MIR tests. Diagram of the experimental design: the original session timeline runs through reproduce and locate, auto-compaction, first patch, and review fetched; the session is truncated at the decision point after the review is fetched, and either a single-variable edit is applied (baseline, no-compaction, no-thinking, reframe, H-a, task-prompt, and four appended sentences) or Sol continues the K3 history, then it is resampled; the fresh control receives only the task description in a new session, once for K3 and once for Sol; all conditions are measured with the same measures: folding, blind grade, and MIR tests.
Figure 1. Experimental design. The original session is truncated at the decision point after K3 fetched the review, a single-variable edit is applied, and the session is resampled; the fresh control receives only the task description in a new session. All conditions are measured with the same set of measures.

3.1 Decision point and resampling

The decision point is placed in the original session after K3 fetched the review and before it began thinking, that is, where K3 first encountered the review and had not yet formed a plan. The original session is truncated at this point, edited according to each condition, and resumed with kimi-code/k3 with all thinking retained; the resume message is a single uniform instruction to continue, with each condition's added sentence appended to it.

Before the main experiment, the validity of transcript edits was verified: on resuming, the context is rebuilt from the session transcript, so editing the transcript takes effect, and a tool call and result inserted in the existing structure are treated by the model as a real tool result.

The no-history control condition (fresh) receives only a frozen task description containing the issue, the root cause, the first patch, and the review text. The two Sol conditions are run by GPT-5.6 Sol: Sol fresh uses the same task description as K3's fresh; Sol + K3 history uses the same history and resume message as baseline, and the differences between the two are described in Section 3.2.

As for sample sizes, fresh, baseline, no-compaction, and no-thinking ran 5 times each, with baseline and no-compaction first running 3 times and then being increased to 5 under a sampling rule set in advance; the other K3 conditions ran 3 times each, and the two Sol conditions 5 times each.

3.2 Conditions and pre-registered predictions

Each K3 condition changes only one variable (Table 1). The conditions were designed in sequence: later conditions were decided after earlier results were in, rather than all being fixed before the experiment began. In this post, "pre-registered" means that each condition's prediction was written down before that condition ran and was not changed afterward.

Table 1. K3 experimental conditions, edits, and pre-registered predictions

Condition History Edit Prediction
fresh None Task description only —
baseline Compacted No edit —
no-compaction Uncompacted Compaction event removed, full pre-compaction history kept More than 1/5
no-thinking Compacted, without K3's thinking All of K3's thinking removed from the compacted history, everything else unchanged 1/5
reframe Compacted The summary sentence that frames the bug replaced with a purely factual one ≥2/3
H-a Compacted One tool call reading the whole function, with its result, inserted at the decision point ≥2/3 (drop the separate scan)
task-prompt Compacted Resume message replaced with fresh's task description —
clarify Compacted One complete sentence of review intent appended to the resume message 3/3
negate Compacted Only the first half of the intent sentence appended 3/3
rethink Compacted Only a reminder to reread the first sentence, with no answer 3/3
direction Compacted Only the second half of the intent sentence appended 3/3

A dash marks a control condition with no prediction set before it ran. The "History" column gives the original session record carried into the resume: "Compacted" is the handoff summary produced by auto-compaction together with the messages after it, and "Uncompacted" is all messages kept after the compaction event is removed. Throughout this post, "with history" means carrying the original session record, compacted or uncompacted, as opposed to fresh, which runs "without history"; it does not refer specifically to the uncompacted transcript.

The four appended sentences read as follows (translated from Chinese):

  • clarify: "Additional note: what arsenm means is don't add a new separate scan; extend the existing check in the function instead."
  • negate: "Additional note: what arsenm means is don't add a new separate scan."
  • rethink: "Additional note: first think through what arsenm's first sentence actually wants us to change."
  • direction: "Additional note: what arsenm means is extend the existing check in the function."

The negate and direction groups test the first and second halves of the clarify sentence separately.

H-a inserts the full text of removeCopyByCommutingDef with the first patch applied, without singling out the pre-check loop, so that the edit does not act as a directional hint. reframe changes only one sentence of the compaction summary; see Section 4.4.

no-thinking removes only K3's thinking from the baseline history, to tell whether the difference between Sol + K3 history and baseline, described below, comes from the model or from K3's own thinking.

In addition, two conditions were run with GPT-5.6 Sol (Table 2). Sol fresh tests whether the success of Sol in the original conversation is stable; Sol + K3 history observes how a different model behaves when resuming the same compacted history. The latter differs from baseline in more than one variable, so it is not a single-variable edit.

Table 2. Sol experimental conditions and pre-registered predictions

Condition Corresponding K3 condition Difference from that condition Prediction
Sol fresh fresh Different model and harness; same task description 5/5
Sol + K3 history baseline Different model, harness, system prompt, and tool set, and no K3 thinking; same history and resume message 5/5

3.3 Measures

In this post, "fold" means that the revision drops the separate scan and extends the existing pre-check loop instead, whether the revision was written into code or only proposed in the reply. Every count follows this definition; the per-run outcomes are given in Table 6 of Appendix A.

Code quality is measured by blind grading. The grader is Claude Sonnet, which reads only the anonymized final code and scores it on a 10-point scale: structure 3, applying the review 3, correctness 3, comments 1. Each run is graded 3 times and the median is taken. Two MIR regression tests serve as a hard anchor, with correctness set to 0 when a test fails; the first patch also passes both tests, so they can only rule out crashes and cannot distinguish implementations.

The first patch already fixes the bug. This study measures adoption of the review, not functional correctness in general. Six of the 10 grading points come from structure and applying the review, so the blind grade is highly correlated with folding and cannot serve as independent evidence of quality. Blind grades are determined mainly by the implementation: folded code scores 9–10, and keeping or replacing a separate scan scores 7–8; runs that only proposed a revision without changing the code are graded on the first patch and score 3–4. The only exception is one run that crashed in the behavioral test. The distribution of grades is shown in Figure 3.

To assess differences at small sample sizes, this post reports two-sided Fisher exact p-values for some comparisons. These comparisons were selected after the fact and are not corrected for multiple comparisons; they are descriptive only. The proportions in Figure 2 are also given with Wilson 95% confidence intervals.

3.4 Reading the reasoning transcripts

The reasoning transcripts were extracted and read by Claude, covering each run's design phase from the start of the resume to the point where it settled on a revision. Of the 19 runs that did not fold, 14 were read in full and used for the classification in Section 5, the 2 no-thinking runs are analyzed separately in Appendix D, and the remaining 3 were only searched by keyword. 4 of the 5 fresh runs were read in full. Thinking transcripts do not necessarily reflect the real causes of behavior, so this post does not ask the model about its reasoning, and the conclusions rest on behavior and code alone. Sol's reasoning is stored encrypted and cannot be read, so for Sol only the final revision is analyzed.

3.5 Practices borrowed from the reference study

Table 3 lists the practices of the reference study and their counterparts in this post.

Table 3. Practices of the reference study and their counterparts in this post

Practice in the reference study Counterpart in this post
When a weak cue fails, escalate to an unambiguous statement Start with the strongest statement of intent (clarify), then weaken it step by step in the same direction
Where an edit is inserted is itself a variable; the closer, the more effective Every appended sentence goes in the most recent turn, at a fixed decision point
One good behavior in the original trajectory may be luck; resample to obtain rates Sol's single success in the original conversation is treated as motivation, not evidence; Sol is resampled 5 times in the fresh condition, and every condition is resampled
Evidence judged in isolation and in its original context may be judged very differently Compare the fresh control against resumes with history
Do not rely on the model's self-explanation Observed measures are limited to behavior and code; the model is not questioned

4. Results

Dot plot of the share of runs in each condition that folded the check into the existing loop, with confidence intervals: fresh 5/5, baseline 1/5, no-compaction 3/5, no-thinking 3/5, reframe 1/3, H-a 0/3, task-prompt 0/3, clarify 3/3, negate 3/3, rethink 0/3, direction 3/3; Sol fresh 5/5, Sol + K3 history 5/5. Dot plot of the share of runs in each condition that folded the check into the existing loop, with confidence intervals: fresh 5/5, baseline 1/5, no-compaction 3/5, no-thinking 3/5, reframe 1/3, H-a 0/3, task-prompt 0/3, clarify 3/3, negate 3/3, rethink 0/3, direction 3/3; Sol fresh 5/5, Sol + K3 history 5/5. Dot plot of the share of runs in each condition that folded the check into the existing loop, with confidence intervals: fresh 5/5, baseline 1/5, no-compaction 3/5, no-thinking 3/5, reframe 1/3, H-a 0/3, task-prompt 0/3, clarify 3/3, negate 3/3, rethink 0/3, direction 3/3; Sol fresh 5/5, Sol + K3 history 5/5.
Figure 2. Share of runs in each condition that folded the check into the existing loop. Points are rates and lines are Wilson 95% confidence intervals; the numbers on the right are folds over runs, and the dashed line marks the baseline rate. The bottom two rows are GPT-5.6 Sol (orange).

Table 4 lists the counts for each condition and the outcome of each prediction.

Table 4. Prediction and result for each condition

Condition N Prediction Result
fresh 5 — 5/5
baseline 5 — 1/5
no-compaction 5 More than 1/5 3/5
no-thinking 5 1/5 3/5
reframe 3 ≥2/3 1/3
H-a 3 ≥2/3 (drop the separate scan) 0/3
task-prompt 3 — 0/3
clarify 3 3/3 3/3
negate 3 3/3 3/3
rethink 3 3/3 0/3
direction 3 3/3 3/3
Sol fresh 5 5/5 5/5
Sol + K3 history 5 5/5 5/5

The results of the two Sol conditions and of no-thinking are given in Section 4.6 and Section 4.7 respectively.

Figure 3 shows the blind grade of every run.

Dot plot of the blind grade of each run in each condition, with shading for the grade ranges of the three implementations: runs that folded in code cluster at 9 to 10, runs that kept or replaced the scan at 7 to 8, and runs that only proposed a revision without changing the code at 3 to 4. Dot plot of the blind grade of each run in each condition, with shading for the grade ranges of the three implementations: runs that folded in code cluster at 9 to 10, runs that kept or replaced the scan at 7 to 8, and runs that only proposed a revision without changing the code at 3 to 4. Dot plot of the blind grade of each run in each condition, with shading for the grade ranges of the three implementations: runs that folded in code cluster at 9 to 10, runs that kept or replaced the scan at 7 to 8, and runs that only proposed a revision without changing the code at 3 to 4.
Figure 3. Blind grade of each run (median of three gradings). Filled dots are runs that folded and hollow dots are runs that did not; dots with the same grade are offset horizontally. Runs that only proposed a revision without changing the code are graded on the first patch and sit at 3–4. The H-a dot at 3 is a run that crashed in the behavioral test. Shading marks the grade ranges of the three implementations. The bottom two rows are GPT-5.6 Sol (orange).

4.1 Without history, K3 can apply the review

All 5 fresh runs folded the check into the existing loop. In implementation, one was logically equivalent to the merged version and three applied readsReg() only to defs. Against baseline, 5/5 versus 1/5 gives p ≈ 0.048; this comparison is also confounded by a difference in model configuration (see Section 8).

4.2 Removing auto-compaction increased folding, but not to the no-history level

The main hypothesis was that phrases in the compaction summary such as "patch written, verified, and approved" made K3 overconfident in the first design.

The direction of the result matched the prediction: no-compaction went 3/5 against baseline's 1/5, and the difference is not significant (p ≈ 0.52). I had further expected no-compaction to approach fresh, or even to produce the merged version; this expectation was not met, as all three folds applied readsReg() only to defs.

The task-prompt group went 0/3: two runs kept the scan and one replaced it with a different scan.

One no-compaction run read the final fix in my local repository, but all of its code edits came before that; the result is kept, and without it no-compaction is 2/4.

4.3 Adding the function's code at decision time brought no improvement

H-a tests the information-gap hypothesis: the pre-check loop appeared only before compaction, so K3 could not see it when deciding.

The H-a group went 0/3. Two runs deleted the first patch's scan but replaced it with another separate scan, one walking the segments of the live interval and one walking the value numbers; the third kept the scan. Whether the prediction held depends on the criterion: by the "drop the separate scan" criterion used in the prediction it is 2/3, and by folding it is 0/3.

However, searching the original session afterward showed that the premise of the hypothesis does not hold. Before compaction, K3 had already read the whole function, treated this loop in its thinking as the closest precedent for its own fix, and deliberately made the new def scan symmetric with it. It also considered readsReg(), but reached the wrong conclusion:

defs don't 'read' unless... a subreg def without undef IMPLIES reading the other lanes — there's no readsReg flag on it

The same holds when resuming: all 5 baseline runs read the pre-check loop on their own at the start of the resume and looked up the definition of readsReg(). Under resume conditions, H-a therefore injected information K3 would have read anyway. The two sentences of the review correspond exactly to K3's two judgments at the time: that a separate scan had to be written, and that readsReg() does not cover defs.

4.4 Replacing the summary's problem-framing sentence brought no improvement

All 4 failed baseline runs based their decision on the same reason: the use list cannot reflect this implicit read, which is the root cause of the bug, so defs must be scanned separately. For example, the reply drafted by one of them:

The existing pre-check scans use operands only; the hazard comes from a def operand (subreg non-undef implicit read), which is invisible in use lists — that's the root cause of the bug. So the def scan is needed, but I switched it to readsReg().

The compaction summary describes the bug with exactly the same framing (translated from Chinese):

but its use-rewrite loop only walks explicit operands (around lines 951-1000), and can't see this implicit read;

By contrast, no run quoted the summary's finality phrases such as "verified" or "approved". I therefore hypothesized that what mattered was the problem framing given by the summary, not the certainty it conveyed.

The edit replaced that sentence with "while that partial def is still implicitly reading the old value of %27 from before the commute (value 4);" (translated). The replacement keeps the bug mechanism, does not mention the pre-check loop, gives no hint of direction, and is of similar length.

The result was 1/3; the prediction (≥2/3) failed, and the result is close to baseline's 1/5. One run in this group that did not fold used the phrase "invisible to the use list" 47 times in its thinking, having derived it on its own from the existence of the bug.

4.5 Stating the review intent explicitly is enough to restore folding; a reminder to rethink is not

The clarify group appended only one sentence of review intent to the resume message, with no implementation details. The result was 3/3, and the prediction held. One of the three has the same shape as the merged version.

The strength of the statement was then reduced step by step in the same direction:

  • negate went 3/3, and the prediction held.
  • rethink went 0/3, and the prediction (3/3) failed.
  • direction went 3/3, and the prediction held. All three applied readsReg() only to defs.

Given separately, each half of the clarify sentence produced 3/3. This result shows only that either half suffices on its own; it does not explain the mechanism. Pooling the clarify, negate, and direction groups, 9/9 against baseline's 1/5 gives p ≈ 0.005, and against rethink's 0/3, p ≈ 0.005.

None of the three rethink runs folded: two switched to other approaches, one walking the value numbers and one checking the instruction at the end of the interval segment; the third kept the scan. All three reinterpreted the first sentence of the review as "the information is already in the interval or an existing data structure, so no scan is needed".

One of them at one point wrote out the correct direction:

So "no new scan over defs" could mean: scan reg_operands (or extend the existing use-loops to reg loops) with MO.readsReg() && MO.getParent() != ....

Its subsequent reasoning, however, turned in another direction:

Hmm wait — actually! Maybe his point is architectural in a different direction

It did not evaluate that option again, and in the end recommended keeping the def scan, adding only an early hasSubRanges() return in front of it.

4.6 Sol folds both fresh and on K3's history

Sol fresh was predicted at 5/5 and went 5/5, with all five implementations logically equivalent to the merged version. K3's fresh group also went 5/5; the difference lies in implementation, as K3 mostly applied readsReg() only to defs.

Sol + K3 history was likewise predicted at 5/5 and went 5/5, so the prediction held. This group is not a single-variable comparison with baseline: Sol sees another model's history without K3's thinking, under a different system prompt and tool set (Section 3.2). Its difference from baseline's 1/5 therefore cannot be attributed to the model alone (see Section 6.3).

4.7 With K3's own past thinking removed, the result falls in between

no-thinking tests whether the difference above comes from K3's own past thinking: it removes only K3's thinking from the compacted history and leaves everything else as in baseline; K3 still thinks as usual when resuming but cannot see its earlier thinking. The prediction was 1/5, the same as baseline. The result was 3/5, so the prediction failed. Under the interpretation set before the runs, 2–3/5 falls between the two explanations: higher than baseline's 1/5 and lower than the 5/5 of Sol on the same history, and 5 runs are not enough to separate the roles of the model and of past thinking.

In addition, the two runs that did not fold thought much less while resuming, so removing past thinking may also have changed how much K3 thinks during the resume (Appendix D).

5. Analysis of reasoning transcripts

This section is an observational analysis of the same data, used to explain the results of Section 4; it does not constitute independent evidence.

5.1 Failures fall into three groups

The criterion is whether a run thought of changing the pre-check loop to walk all operands and distinguishing defs from uses inside the loop. By this criterion, the 14 failed runs read in full fall into three groups (Table 5):

Table 5. Classification of the 14 failed runs read in full

Group Runs Typical behavior
Decision failure: saw the correct structure but did not use it 5 Dropped it for reasons such as clarity first, too large a change, "I don't think" being mere hedging, leaving the choice to the reviewer, or deferring to the next round; 2 of them wrote out the complete code
No workable way found 6 Assumed folding meant applying one condition to every operand, saw that this would block ordinary uses, and fell back to scanning defs only
Misread the review's intent 3 Read the first sentence as "don't scan defs; use the information in the live interval instead"

A sentence-by-sentence check shows that the failed runs described the pre-check loop and readsReg() itself correctly; the failures did not stem from misreading the code. The three groups differ in nature. The first is a decision failure: the correct structure was written out but abandoned because of review strategy or an earlier conclusion. Most runs in the second group had understood that the review required folding into the existing loop; the obstacle lay in the implementation, and what was missing was the step of branching on def versus use inside the loop (see Section 5.2). Only an individual run in this group misunderstood the intent, for example an H-a run that held that walking all operands covers a larger set and so could not be what the reviewer meant: "That's a superset — but my def_operands scan is smaller. So "no new scan" can't mean that." The third group misread the review's intent, and the 3 rethink runs also belong to it (see Section 4.5). Decision failures do exist, but they account for only 5/14 of the runs read in full.

5.2 Runs without history met the same obstacles but treated the first sentence as a hard constraint

All 5 fresh runs encountered the obstacle that "the loop at line 922 only walks uses". One of them also ran into the problem that "applying readsReg() to every operand would block ordinary uses", and another likewise considered review strategy:

The "I don't think you should need a new scan over defs" is a "I don't think" — a suggestion/question.

The difference lies in what followed: all 5 treated the first sentence as a constraint that had to be met and explicitly rejected the option of keeping the scan and only switching to readsReg(). For example:

But that still has a "new scan over defs", which the reviewer questions.

They resolved it by redefining what the existing check intercepts. The same run wrote:

So the existing check is a specific case of "a read of AValNo that cannot be rewritten to NewReg". A partial def reading AValNo also cannot be rewritten.

What the 6 runs that found no workable way were missing is exactly this step of branching on def versus use inside the loop.

5.3 Failed runs with history kept their earlier conclusion or cited review strategy

The first kind of reason is adherence to an earlier conclusion. "It is invisible, so a scan is required" is a conclusion K3 reached on its own before compaction, which the summary carried into the resume; the raw history of the no-compaction group contains the same reasoning. The input of fresh contained only the patch and the review, so "invisible" was merely a fact noticed while reading the code. A reframe run went further and inferred that folding is equivalent to scanning only defs:

Scanning reg_operands with (MO.isDef() && MO.readsReg()) == scanning def_operands with readsReg (same set, since def_operands = reg_operands filtered by isDef). So either formulation is equivalent; def_operands is cleaner.

The second kind of reason is review strategy. A no-compaction run wrote out the complete folded code and then wrote:

This is arguably the "no new scan" ideal. But it rewrites arsenm's existing loop — bigger diff, higher review friction. My recommendation: minimal variant (readsReg filter, keep separate loop), mention in reply that the check complements the tied-use guard right below and can be merged into one reg_operands walk if he prefers. Give him the choice in the reply — reviewers love that.

Another reframe run likewise wrote correct code and ultimately chose to defer the change:

If he then says "fold it into the existing loop" or "use interval valnos", we do that next round. That's a normal review dialogue — you don't have to preempt everything.

No reason of this kind appears in the runs without history.

6. Discussion

6.1 What the edit experiments support

By strength of evidence, the results of Section 4 support the following judgments:

  • Stronger: the failure cannot be put down simply to a lack of capability. K3 without history went 5/5, against 1/5 for baseline (p ≈ 0.048).
  • Stronger: one explicit statement of intent is enough to make K3 with history fold. The complete intent sentence and each of its halves given alone all went 3/3, 9/9 in total; rethink went 0/3.
  • Weaker: auto-compaction may have played a part. Removing compaction gave 3/5, not significantly different from baseline (p ≈ 0.52).
  • Negative: neither an information gap nor the summary's framing sentence is the main cause. Adding the function's code (0/3) and replacing the framing sentence (1/3) brought no improvement, and K3 reads that code on its own when resumed.

The second point is consistent in direction with the reference study's finding: when a weak cue fails, an unambiguous statement is needed to change the behavior.

The two failed predictions are also informative. That reframe had no effect shows that the sentence is not the only source of the framing: K3 derives the same framing on its own. That rethink had no effect shows that the problem is not whether the review is re-examined, but the interpretation reached upon re-examination.

6.2 An untested explanation

Taking Section 4 and Section 5 together: faced with an ambiguous review, K3 with history tends to resolve the ambiguity toward "keep the current design and reply with an explanation", whereas K3 without history treats the same review as a hard constraint.

I initially took this to be a capability problem, or a sign that K3 handles uncertain tasks poorly. The fresh group, however, faced the same ambiguous review and went 5/5, which shows that K3 can produce the correct revision under at least some conditions, so the failure cannot be put down simply to a lack of capability. Fresh runs and resumes with history nonetheless differ in context length, information organization, and task description, and these differences have not been fully separated. In light of the fresh runs' reasoning, my current explanation is that the behavior more likely stems from preferences, pattern matching, and strategies learned in training, which in a long history manifest as adherence to the model's own earlier conclusion or as the application of a "minimal change" review strategy.

6.3 About Sol

My agreement with Sol's version stems from a prior that I had not shared with any model at the time. Earlier, in #202599, I had attempted to fix a related RegisterCoalescer problem; that attempt was ultimately superseded by bababuck's #204039, which changed only a few lines of the existing logic, and #202599 was eventually merged as regression tests only. I studied the approach of #204039 closely at the time, and it left me with a prior: keep the existing structure and extend an existing check.

Sol succeeded only once in the original conversation. Resampling in the fresh condition shows that Sol produces the correct revision reliably on this task: Sol and K3 both went 5/5 fresh, differing only in implementation (Section 4.6). Resuming K3's history, Sol still went 5/5, which shows that this history, with K3's thinking removed, is not enough to make Sol give up folding; compared with baseline's 1/5, however, the difference may come from the model or from the removed K3 thinking. K3 with its thinking removed went 3/5, in between (Section 4.7), and 5 runs are not yet enough to separate the two factors.

7. Implications for coding agent design

The following are conjectures drawn from the results of this post. None has been tested, and whether they work still has to be checked by resampling at the same decision point.

Restate the review as constraints. One explicit statement of intent brought K3 with history from 1/5 back to 3/3, which suggests that what it lacked may not have been a plan but confirmation of which requirements had to be met. Having the agent list the hard constraints in the review before it starts designing might have a similar effect; rethink's 0/3, however, shows that the agent's own restatement is not necessarily correct.

Propose revisions with a sub-agent that has no history. Without history, K3 went 5/5, so one could imagine a sub-agent with no session history proposing the revision while the main agent integrates it. The main agent might still reject the sub-agent's proposal on the strength of its own earlier conclusion (Section 5.3), so the actual effect is uncertain.

Use the decision point as an eval case. The decision point in this post could serve as an eval case derived from a real trace: fix the history prefix and the resume message, then measure the fold rate; the three failure groups may also correspond to signals that can be checked automatically. A single case has limited representativeness, and whether it generalizes to similar situations remains to be seen.

8. Limitations

Each condition ran only 3–5 times; the p-values are descriptive only and are not corrected for multiple comparisons. The conditions were designed in sequence, with later conditions informed by earlier results, although every prediction was written down before its condition ran. This mainly affects the weaker judgment (Section 6.1): the difference between no-compaction's 3/5 and baseline's 1/5 cannot be distinguished from sampling variation, whereas the gaps between fresh's 5/5 and baseline's 1/5, and between the pooled 9/9 of the intent-statement groups and rethink's 0/3, are large and less affected.

Both the primary metric and the scoring rule were fixed after part of the results had been seen. The blind grade is highly correlated with folding and mainly reflects whether the review was adopted rather than code quality in an independent sense; the two regression tests cannot distinguish implementations either.

The experiment resumed with kimi-code/k3, which has a 1M window, whereas the original session used k3-agent with a 256k window, so the no-compaction condition exists only in the experiment; every resume is a single response without the multi-turn feedback from later in the original session. These differences are the same across conditions, so they limit how far the conclusions generalize to the original session rather than the comparisons between conditions. Isolation was also incomplete: network access was restricted only by the prompt, one run read the final fix (see Section 4.2), another installed build tools from the network after changing the code, and the isolated clones carry artificial traces in their dates, branch names, and commit authors.

Sol + K3 history is not a single-variable edit, so its result can only serve as a comparative observation; Sol's reasoning is encrypted and cannot be analyzed as K3's can. The input of Sol in the original conversation included my remark that "K3's changes still aren't right", so it is not fully equivalent to the fresh condition; the Sol fresh group in the experiment, by contrast, had exactly the same input as K3's fresh runs.

9. Open questions for future work

This post studies a single decision point. It raises the following questions, to which I do not yet have answers.

First, how should an agent carrying a long history treat its own earlier conclusions? Holding to an earlier judgment is not always wrong, and a review is not always right. K3's problem here was not holding its position as such, but failing to tell which parts of the review were requirements that had to be met. Whether an agent can learn to distinguish negotiable suggestions from constraints it must not violate, and whether that distinction should be drawn by the model itself or prompted explicitly by the harness, remains unclear.

Second, what in the history is actually at work? This post ruled out an information gap and the framing sentence in the summary, and removing past thinking brought folding back only to 3/5 (Section 4.7). Appendix D further suggests that history does not merely supply information but may also shape how the model thinks afterward. If so, what to compact, what to keep, and when to start over are not just engineering questions about saving context window.

Third, without history both K3 and Sol get it right; the gap appears only with history. Whether this gap comes from a preference for staying consistent formed in training, or from something else, this post cannot determine; and even if it is the former, whether it can be measured and improved through training or evaluation is so far only a guess.

Finally, all of these questions need samples far larger than a single decision point. Systematically collecting the moments at which external feedback conflicts with an agent's earlier conclusion may be the first step toward answering them.

Appendix A: Per-run results

Table 6. Revision and blind grade of each run

Run Condition Revision Blind grade
r005 fresh Folded 9
r008 fresh Folded 10
r009 fresh Folded 9
r010 fresh Folded 9
r011 fresh Folded 4
r012 baseline Kept scan 4
r015 baseline Kept scan 4
r018 baseline Kept scan 7
r021 baseline Kept scan 4
r022 baseline Folded 4
r013 no-compaction Folded 9
r019 no-compaction Folded 9
r023 no-compaction Folded 9
r016 no-compaction Kept scan 4
r024 no-compaction Kept scan 3
r062 no-thinking Folded 9
r063 no-thinking Folded 4
r064 no-thinking Another approach 4
r065 no-thinking Folded 4
r066 no-thinking Kept scan 7
r034 reframe Kept scan 7
r035 reframe Folded 9
r036 reframe Kept scan 3
r025 H-a Kept scan 4
r026 H-a Replaced with another scan 8
r027 H-a Replaced with another scan (test crashed) 3
r014 task-prompt Kept scan 7
r017 task-prompt Replaced with another scan 7
r020 task-prompt Kept scan 7
r037 clarify Folded 9
r038 clarify Folded 10
r039 clarify Folded 4
r044 negate Folded 4
r045 negate Folded 9
r046 negate Folded 9
r047 rethink Another approach 4
r048 rethink Kept scan 4
r049 rethink Another approach 3
r050 direction Folded 9
r051 direction Folded 9
r052 direction Folded 9
r007 Sol fresh Folded 10
r053 Sol fresh Folded 10
r054 Sol fresh Folded 10
r055 Sol fresh Folded 10
r056 Sol fresh Folded 10
r057 Sol + K3 history Folded 4
r058 Sol + K3 history Folded 10
r059 Sol + K3 history Folded 4
r060 Sol + K3 history Folded 10
r061 Sol + K3 history Folded 3

Blind grades are based on the final code; runs that only proposed a revision without changing the code are graded on the first patch, so some folded runs score 3–4.

Appendix B: Corrections during analysis

The following three lapses at one point changed the explanation of the failure.

  • The original session was not searched before H-a was designed. Claude's analysis only confirmed that the code of the pre-check loop appeared before compaction, and did not find that K3 had at the time treated it as a precedent and written a separate scan modeled on it. Without knowing this, I approved the design and set the prediction. The procedure has since been changed: before designing any insertion or deletion edit, everything relevant in the original session is searched first.
  • Counting. Claude once reported that baseline "folded 0/5", missing a run that proposed folding only in its reply; after I asked, this was corrected to 1/5. The early label "dropped the separate scan" also counted "replaced with another scan". Since then, the per-run results table has been the single source.
  • Failure classification. Based only on keyword snippets covering about 6% of the text, Claude first concluded that "10 of the 14 failures clearly found the correct approach"; after the full text was read, this was corrected to 5 / 6 / 3.

Appendix C: Experimental infrastructure

Resuming. The command is kimi -S <session_id> -p ... --output-format stream-json, and the resume message reads "Continue. (Note: use only the local repository, do not go online.)" (translated from Chinese). A resume can be truncated after a given tool result, but it appends a new user message and re-injects a permission notice, so it does not seamlessly continue the same turn. The original session was created in Kimi Work, and its model alias k3-agent is unavailable in the CLI; resuming became possible only after the alias was changed to kimi-code/k3. Resumes reuse the system prompt from the transcript, with a hash matching the original session's; the 13 core tools are the same, with 7 additional Kimi Work tools and 2 missing.

Runs. Each run first creates an independent clone, applies and commits the first patch, and verifies the file hash, and is then launched as an independent background process. The launcher keeps its own time, kills the whole process tree on timeout, and then collects the diff, the session transcript, token usage, and the network audit. The time limit is 30 minutes, and runs that hit the limit or were interrupted are scored on their state at termination; normal completions and timeouts both count toward the sample, while CLI errors (such as exhausted quota) do not, and the same condition is rerun. To save quota, some conditions ran from a shared clone path so that the history prefix hit the cache; to keep samples from duplicating one another, a rule was fixed in advance to stop a group if the first thinking block of a later run matched the first run's word for word. The rule was not triggered.

Isolation. Codex's sandbox on Windows does not block the network, and the K3 side has no network restriction either, so network access was restricted only by the prompt and checked by after-the-fact auditing. The audit found no network access, but one no-thinking run installed build tools from the network after changing the code and the audit missed it, which shows that keyword-based auditing has gaps. Some runs accessed files outside their run directory after settling on a revision; apart from the one that read the final fix (see Section 4.2), none touched the answer. These out-of-bounds accesses show that for an agent with history, paths and user names are themselves clues, and isolation by directory is insufficient; completed run directories moved out of the run area could still be found by a whole-disk search. Later experiments should move completed runs to another disk or archive them; a more robust approach is a separate system account or a virtual machine.

Grading. For blind grading, runs from the same batch are mixed and randomly numbered. The grader is a Claude Sonnet sub-agent that cannot see the condition and is not the model under test. A review rule also applies: a total of ≥ 8 with a failed test, or ≤ 4 with a passed test and the separate scan dropped, is referred for manual review.

Resuming with Sol. For Sol + K3 history, the request K3 actually received at the decision point in the baseline group was taken, K3's system prompt and thinking were removed, and the result was converted into a Codex session, to which the same resume message as baseline was then sent. The converted history kept K3's tool names.

Appendix D: Interesting and unexpected failures

Before the no-thinking group (Section 4.7) ran, I expected that removing K3's past thinking would change nothing, and predicted 1/5, the same as baseline; the result was 3/5. What caught my attention more than this number were the group's two runs that did not fold: compared with the rest of the group and with baseline, they show two notable phenomena.

The first is that both runs made their decision without ever reading the pre-check loop. All of one run's tool calls queried register and instruction interfaces, and it never opened RegisterCoalescer.cpp; it read the first sentence of the review as "don't scan only the def list", widened the scan to all instructions, and still ended up with a separate loop. The other settled on a plan within two steps and changed the code at the third. It did consider walking all operands with readsReg(), but dropped the idea for this reason:

A normal use operand would be rewritten by the commute code, so skipping them via def_operands is right

This judgment confuses the use-rewrite loop that comes later with the pre-check loop that comes before it, and matches both the compaction summary's wording and the reason given by the failed baseline runs (Section 4.4). So even with K3's earlier thinking removed, the problem framing in the summary may still steer its judgment. By contrast, the group's three runs that folded had all read the function.

The second is that, unable to see its earlier thinking, K3 hardly thought at all. Both runs thought far less while resuming: all 8 thinking blocks of the first were empty, and 17 of the second's 36 were empty, whereas the runs that folded in this group, like the baseline runs, thought at nearly every step. One possible explanation is that the model continues the format of its history: with no thinking in the history, it tends to think less or not at all. If so, the no-thinking group changed not only whether earlier reasoning was visible but also how much the model thinks while resuming. This has not been tested, but it made me realize that when a history is edited, what is removed may affect the model's later behavior in unexpected ways: meaning to take away only its past reasoning, one may also change how it thinks now.

Experimental data as of October 13, 2026.