A tagged instruction pointer built by scheduled code is a proved reference #659

Manually merged
binjovi-bot merged 1 commit from rpg-9-ax-scheduled-pointer-20261029 into trunk 2026-10-29 04:16:05 +00:00
Owner

A tagged instruction pointer built by scheduled code is a proved reference

The constant area holds tagged instruction pointers that the code builds:
addi A, r28, D; li T, 0xa2; rldicr P, T, 56, 7; settag; stq P with P even
and A = P + 1. constant_references.constructor proves a pointer only from
that exact, contiguous sequence. In programs with file I/O the compiler
schedules the steps among unrelated loads and stores and orders them as the
data allows (shared-io-full: li r3,0xa2; addi r27,r28,0x10; lwz; rldicr r26,r3; settag; stw; extsw; stw; stq r26, and settag before rldicr
elsewhere). Those pointers stayed unproved: their bytes were compared as they
are, and a relocated twin differed in constant_area (17 unproved pointers in
shared-io-full, 0 after this change; the counts of the previous change).

scheduled proves the same steps by a forward data flow over the procedure:
per register it knows li 0xa2, the tag (rldicr of that), a copy of it
(ori P, Q, 0), or an address r28 + D, met over the decoded branches; a call
clears the volatile registers (r0, r3 to r12) and the settag; the code
addresses that the constant area's instruction pointers name (the computed
return points) and every instruction without p-code but settag and the
traps know nothing. A stq P of a pair with the tag in P, r28 + D in P + 1
and a settag before it proves the pointer at D; instructionPointer still
checks its 16 bytes. The tag kept in a register from an earlier pointer
(addi r27, r28, 0x308; stq r26) is proved the same way.

The owner check of a computed return is scheduled the same way: ld r3,0(r27); ld r4,0x3e0(r28); ld r0,8(r27); tdne r4,r0; mtctr r3; bctr puts the target
load first. ownerCheckReordered accepts the three loads in any order when
they are exactly the three instructions before the trap. shared-io-full has no
unproved pointer left (17 before).

Gates

{"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden 173/5/0 == dump 173/5/0","emit":{"worse":[],"better":47,"newly_clean":47,"clean_delta":47,"base":215,"new":262},"twins":{"groups":457,"recovered":449,"regressions":[],"newly":34},"allgroups":{"regressions":[],"newly":["rpg-corpus-captures/files-chain/stripped/object.savf 2","rpg-corpus-captures/files-display-write/stripped/object.savf 2","rpg-corpus-captures/files-logical/stripped/object.savf 2","savf/SC-CONSTRUCT/POINTER/rpg-pointer-procedure-auto/stripped/archive.savf 1","savf/SC-ILE/DSPLY/error-observable/archive.savf 2","savf/SC-ILE/DSPLY/error-stripped/archive.savf 2","savf/SC-ILE/DSPLY/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/d4-edit/stripped/object.savf 3","savf/SC-ILE/EXPERIMENTS/d4-editc-codes/stripped/object.savf 16","savf/SC-ILE/EXPERIMENTS/d4-out-const/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-input/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-srcstmt-dspf/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7-args/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7c-copy/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/decimal-fault-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/decimal-sign-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j1/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j2/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j3/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/format-base/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/format-rename/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/gotos-static/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/h-editc/stripped/object.savf 17","savf/SC-ILE/EXPERIMENTS/h-editc3/stripped/object.savf 24","savf/SC-ILE/EXPERIMENTS/h-editc5/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc6/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-fmix/stripped/object.savf 11","savf/SC-ILE/EXPERIMENTS/h-subind/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/packed-add-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/packed-compose-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/packed-compose-sign-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/program-literal/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5b-onexit-for/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/r5e-date-field/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5e-editc-held/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5i-figurative/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-float-inz/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-reset-ds/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-fixed/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-two/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-full/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-none/stripped/archive.savf 2","savf/SC-ILE/MONITOR/limits-observable/archive.savf 1","savf/SC-ILE/MONITOR/limits-stripped/archive.savf 1","savf/SC-ILE/MONITOR/stripped/archive.savf 2","savf/SC-ILE/TSTRIP-STRIPPED/archive.savf 2","savf/SC-ILE/TSTRIP/archive.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":711}}
# A tagged instruction pointer built by scheduled code is a proved reference The constant area holds tagged instruction pointers that the code builds: `addi A, r28, D; li T, 0xa2; rldicr P, T, 56, 7; settag; stq P` with P even and A = P + 1. `constant_references.constructor` proves a pointer only from that exact, contiguous sequence. In programs with file I/O the compiler schedules the steps among unrelated loads and stores and orders them as the data allows (shared-io-full: `li r3,0xa2; addi r27,r28,0x10; lwz; rldicr r26,r3; settag; stw; extsw; stw; stq r26`, and `settag` before `rldicr` elsewhere). Those pointers stayed unproved: their bytes were compared as they are, and a relocated twin differed in `constant_area` (17 unproved pointers in shared-io-full, 0 after this change; the counts of the previous change). `scheduled` proves the same steps by a forward data flow over the procedure: per register it knows `li 0xa2`, the tag (`rldicr` of that), a copy of it (`ori P, Q, 0`), or an address `r28 + D`, met over the decoded branches; a call clears the volatile registers (r0, r3 to r12) and the settag; the code addresses that the constant area's instruction pointers name (the computed return points) and every instruction without p-code but `settag` and the traps know nothing. A `stq P` of a pair with the tag in P, `r28 + D` in P + 1 and a settag before it proves the pointer at D; `instructionPointer` still checks its 16 bytes. The tag kept in a register from an earlier pointer (`addi r27, r28, 0x308; stq r26`) is proved the same way. The owner check of a computed return is scheduled the same way: `ld r3,0(r27); ld r4,0x3e0(r28); ld r0,8(r27); tdne r4,r0; mtctr r3; bctr` puts the target load first. `ownerCheckReordered` accepts the three loads in any order when they are exactly the three instructions before the trap. shared-io-full has no unproved pointer left (17 before). ## Gates ``` {"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden 173/5/0 == dump 173/5/0","emit":{"worse":[],"better":47,"newly_clean":47,"clean_delta":47,"base":215,"new":262},"twins":{"groups":457,"recovered":449,"regressions":[],"newly":34},"allgroups":{"regressions":[],"newly":["rpg-corpus-captures/files-chain/stripped/object.savf 2","rpg-corpus-captures/files-display-write/stripped/object.savf 2","rpg-corpus-captures/files-logical/stripped/object.savf 2","savf/SC-CONSTRUCT/POINTER/rpg-pointer-procedure-auto/stripped/archive.savf 1","savf/SC-ILE/DSPLY/error-observable/archive.savf 2","savf/SC-ILE/DSPLY/error-stripped/archive.savf 2","savf/SC-ILE/DSPLY/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/d4-edit/stripped/object.savf 3","savf/SC-ILE/EXPERIMENTS/d4-editc-codes/stripped/object.savf 16","savf/SC-ILE/EXPERIMENTS/d4-out-const/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-input/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-srcstmt-dspf/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7-args/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7c-copy/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/decimal-fault-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/decimal-sign-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j1/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j2/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j3/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/format-base/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/format-rename/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/gotos-static/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/h-editc/stripped/object.savf 17","savf/SC-ILE/EXPERIMENTS/h-editc3/stripped/object.savf 24","savf/SC-ILE/EXPERIMENTS/h-editc5/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc6/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-fmix/stripped/object.savf 11","savf/SC-ILE/EXPERIMENTS/h-subind/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/packed-add-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/packed-compose-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/packed-compose-sign-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/program-literal/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5b-onexit-for/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/r5e-date-field/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5e-editc-held/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5i-figurative/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-float-inz/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-reset-ds/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-fixed/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-two/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-full/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-none/stripped/archive.savf 2","savf/SC-ILE/MONITOR/limits-observable/archive.savf 1","savf/SC-ILE/MONITOR/limits-stripped/archive.savf 1","savf/SC-ILE/MONITOR/stripped/archive.savf 2","savf/SC-ILE/TSTRIP-STRIPPED/archive.savf 2","savf/SC-ILE/TSTRIP/archive.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":711}} ```
A tagged instruction pointer built by scheduled code is a proved reference
All checks were successful
binjovi/ci Binjovi completed the frozen plan
63488a86d5
The compiler interleaves the construction of a constant-area instruction
pointer with unrelated instructions, orders its steps as the data allows,
and reuses the tag register of an earlier pointer (shared-io-full).
constructor proved only the exact contiguous form, so those pointers stayed
raw and a relocated twin differed in constant_area. scheduled proves them
with a forward data flow over the procedure: register contents met over the
branches, volatile registers cleared by calls, nothing known at computed
return points or at instructions without p-code but settag and traps.
binjovi-bot manually merged commit 63488a86d5 into trunk 2026-10-29 04:16:05 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/sourcerer!659
No description provided.