Repository navigation
Keep generated declarations and the Intersect pragma above function annotations - #1807
Merged
foxtacles merged 1 commit intoOct 26, 2026
Conversation
…nnotations The saved seats for the vectorlength.inl.h declaration carrier and the opening pragma_optimize directive in legoroi.cpp resolved to the line break directly above the function, splitting it from its // FUNCTION: annotations in the generated source. Re-seat both on the blank line above the annotation block; the token context is unchanged, so every compiled token keeps its line and the output stays byte-identical. Digests re-derived with rbit source regenerate --apply.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the source that ReproBit generates (the source view in the CI artifact and the one reccmp reads), two inserted lines landed between a function's
// FUNCTION:annotations and the function itself:vectorlength.inl.h:class MxUnkRecordZ0400;/class MxUnkRecordZ0401;aboveVector4::NormalizeQuaternionlegoroi.cpp:#pragma optimize("y", off)aboveLegoROI::IntersectBoth now sit above the annotations. The compiler still sees the same code on the same line numbers, so the binaries don't change. A cold
rbit verifystill matches all three retail files, authenticity is clean, and the intervention cost is unchanged (58,553).Why it happened
ReproBit doesn't choose these positions when it generates the source. Each inserted line has a saved position in
reprobit/interventions/shared-lego1.json. That position is the code around it, plus the exact text of the line just before and just after the insertion. Comments don't count as code, so every line break between#include "vector4d.inl.h"andint Vector4::NormalizeQuaternion()is the same place to the compiler. The saved line pair happened to name the break directly above the function. That choice came over from the older tooling when the function moved into this file. The pragma was saved as "right before the next piece of code", and a position like that always ends up below any comments. I scanned the whole generated tree, and these were the only two cases.How it was fixed
reprobit/interventions/shared-lego1.json, only the two saved positions change. The neighbouring lines are stored as the sha256 of the line text without its newline:vectorlength.inl.h:line_before= the empty line,line_after=// FUNCTION: LEGO1 0x10002b70. The old pair was theBETA10annotation line and the function's first line.ctx(the surrounding code) stays the same.legoroi.cpp, thepragma_optimizeop with"state": "off": drop"at": "before_token"and add the same kind of line pair (line_before= the empty line,line_after=// FUNCTION: LEGO1 0x100a9410). The closing#pragma optimize("", on)already uses this form.rbit source regenerate . --applyupdates the stored digests of the generated text: the two files'effectivedigests, pluslegoroi.cpp's source digest in its TU record and inbuild-plan.json.rbit validate .,rbit source export .to look at the result, then a coldrbit verify ..rbit repairisn't needed. It handles edits to source files, and no source file changed here.🤖 Generated with Claude Code
https://claude.ai/code/session_01C6Mx18sFGvm5XSSK9oSu7q