Move derived loop facts into structured checking - #205
Merged
Conversation
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.
Summary
active base + small nonnegative literalloop facts while the structured checker consumes declarations, control flow,
and assignments
mir_loop_factsbefore QBE emission3, andthe now-unused emitter
function_endfieldouter-loop derived facts
The QBE adapter now receives both accepted induction shapes through the same
checked-program fact boundary. Nested facts follow an already-derived enclosing
fact instead of rescanning token ranges, and the adapter never reconstructs a
derived initializer from source tokens.
Scope
This is the bounded ownership migration registered in #204. It does not add
general range propagation, dominance, interprocedural analysis, a serialized
MIR field, a backend option, or language/runtime behavior. The active-loop
emitted-value carrier and direct base-plus-literal expression propagation remain
temporary until the next general Native MIR control/value slice replaces them.
Verification
trb fmt --check compiler/gate4/src/compiler.trb compiler/gate4/src/compiler_test.trbtrb check --config compiler/gate4/trbconfig.jsoncTYPE_RB_NATIVE_ROOT="$PWD" trb test: 80/80trb test --config compiler/gate4/trbconfig.jsonc: 62/62candidate QBE: literal-zero, derived, reassigned, non-unit, dynamic,
negative, non-adjacent, and conditional
that dependency; the generated path retains negative-index normalization and
an executable negative-index probe prints
40byte-identical compiler QBE; the local linker varied only the Mach-O UUID and
signature, so hosted exact executable identity remains authoritative
f90ecf48bfb7a95a03b645130a6891de5b75b7af8ebfc0240996530821481bbdpasses at 299,656 Darwin bytes, 271,928 Linux bytes, and 571,584 bytes
combined; target-neutral QBE is 956,214 bytes with the same SHA-256 recorded
locally
passes at 299,696 and 271,920 stripped compiler bytes, 571,616 combined,
while preserving the lifecycle and memory evidence
passes the current amd64 and arm64 regressions and cross-target contract
passes every repository, runtime, benchmark, closure, and Go-free bootstrap
check on exact head
0fdc4b6ebfe71f7135cbaa2a5caab6626dc90bdcCloses #204