Operation 65 is the step of an array element address (touches rpg_eval.zig) #715

Manually merged
binjovi-bot merged 9 commits from sourcerer-op65-element into trunk 2026-11-04 12:57:21 +00:00
Owner

Operation 65 is the step of an array element address (touches rpg_eval.zig)

After operation 138 got its arm the failing operation of the array element
shape moved to 65. In 34 A 0; ...; 27 K; 138; 78 4; 65 W; 32 A 0 TE the
operation takes the zero-based index and the address of the array and leaves
the address plus index * W, W the element width (9, 9 and 1 on the public
twins decimal-fault-report 45, decimal-sign-report 55 and OPS cond-not 26).
rpg_eval_ops.zig has the arm: a constant index becomes a plain offset, a
variable index becomes an element address whose - 1 is dropped to give the
one-based index. rpg_eval.zig has two edits, in their own commit: the new
Value variant element_address (with its refusal in the two exhaustive
switches over Value) and one case in arm 32 that reads it as
NAME(index) after checking the symbol, the offset and the element width.
rpg_op65_test.zig drives the three twins through arms 65 and 32.

A character part of an indexed array element reads as %SUBST of the element

65 W is followed in two more shapes (SC-ILE/EXPERIMENTS l3b-ds-var and
l3b-subst-var, captured 2026-11-04 with their constant-index controls):
27 K; 62; 32 A 0 TE for a field of an array of data structures
(rec(i).name, K the field offset) and 27 P; 75 8; 35 T1; 27 T1; 27 ONE; 52; 27 L; 75 8; 77 8; 35 T2; 62; 32 X 0 TE for %SUBST(names(i): P: L).
Both are the bytes OFF..OFF+LEN of the element; the head may be 34 A 0 or
33 A. rpg_array_element.zig reads them as one unit (a character TE
no wider than the rest of the element; an integer field, and every store
into an element, stay unmatched) and rpg_eval_builtins.zig gives
%SUBST(A(N): OFF + 1: LEN).

Decision rule, field or substring: the operations do not tell. A field at
a constant offset and a %SUBST at the same bytes are the same bytes, and
the compiler folds a constant position into the same offset. The unit
therefore always gives the neutral form, which recompiles to the same
bytes, and the array is declared char(W) dim(D) from the fact. Only the
declaration can say that the bytes are a subfield (a data structure array
with that field at that offset), and that is the declaration stage's
decision (rpg_source_decl_emit.zig), not the unit's. l3b-ds-var therefore
reads %SUBST(A(I): 5: 9) of a char(13) dim(5) until the declaration
stage recovers the data structure.

Not in this change: the stores (65 W; 27 c; 42 A 0 TE, 65 W; 27 K; 62; ...; 42), and an integer field read (65 13; 32 A 0 TE with a four-byte
TE), which need the store path and the type of the field.
The six captures are adopted as public twins (the matrix rows are classed
by the coordinator).

%SUBST of a part of a data structure passes operation 62 (touches rpg_eval.zig)

Five public statements of SC-ILE/EXPERIMENTS h-subfill stopped at 62 with
value_flow / stack_value: H = %subst(R.c : 2 : 3), %subst(R.c : 1 : 2) = 'ab', H = %subst(ub : 3 : 4), %subst(ub : 2 : 3) = C and
R.a = %subst(R.c : 3). The unit of rpg_subst_offset.zig (27 START; 75 8; 35 T; 33|34 B; 27 T; 27 1; 52; 27 LEN; 75 8; 77 8; 35 N; 62) did not read
two forms of them:

  • the base address is on the stack before the start is kept (a part of a
    data structure of the form 33 R; 27 K; 62): recoverStacked reads the
    eleven operations without the base operation;
  • the base is 34 B off with a nonzero offset (ub, a subfield of a
    data structure without a name): recoverPart accepts it and checks the
    range from the offset. recover is unchanged for its other caller
    (rpg_decimal_call.zig).

rpg_eval.zig has the one edit: arm 62 asks recoverPart, then
recoverStacked, for the offset START - 1 of a text start. The fourth and
fifth statements pass; %subst(R.c : 3) (no length operand) still stops at
62 and is the next shape. Twins: no regression; emit: three statements more
(h-subfill and l3b-subst-const).

Gates

{"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"current","emit":{"worse":[],"better":1,"newly_clean":0,"clean_delta":0,"base":322,"new":322},"twins":{"groups":468,"recovered":460,"regressions":[],"newly":6},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/h-subfill/stripped/object.savf 4"],"worse":[]},"full_check":{"exit":0,"seconds":1152}}
## Operation 65 is the step of an array element address (touches rpg_eval.zig) After operation 138 got its arm the failing operation of the array element shape moved to 65. In `34 A 0; ...; 27 K; 138; 78 4; 65 W; 32 A 0 TE` the operation takes the zero-based index and the address of the array and leaves the address plus index * W, W the element width (9, 9 and 1 on the public twins decimal-fault-report 45, decimal-sign-report 55 and OPS cond-not 26). `rpg_eval_ops.zig` has the arm: a constant index becomes a plain offset, a variable index becomes an element address whose `- 1` is dropped to give the one-based index. `rpg_eval.zig` has two edits, in their own commit: the new `Value` variant `element_address` (with its refusal in the two exhaustive switches over `Value`) and one case in arm 32 that reads it as `NAME(index)` after checking the symbol, the offset and the element width. `rpg_op65_test.zig` drives the three twins through arms 65 and 32. ## A character part of an indexed array element reads as %SUBST of the element `65 W` is followed in two more shapes (SC-ILE/EXPERIMENTS l3b-ds-var and l3b-subst-var, captured 2026-11-04 with their constant-index controls): `27 K; 62; 32 A 0 TE` for a field of an array of data structures (`rec(i).name`, K the field offset) and `27 P; 75 8; 35 T1; 27 T1; 27 ONE; 52; 27 L; 75 8; 77 8; 35 T2; 62; 32 X 0 TE` for `%SUBST(names(i): P: L)`. Both are the bytes OFF..OFF+LEN of the element; the head may be `34 A 0` or `33 A`. `rpg_array_element.zig` reads them as one unit (a character `TE` no wider than the rest of the element; an integer field, and every store into an element, stay unmatched) and `rpg_eval_builtins.zig` gives `%SUBST(A(N): OFF + 1: LEN)`. Decision rule, field or substring: the operations do not tell. A field at a constant offset and a `%SUBST` at the same bytes are the same bytes, and the compiler folds a constant position into the same offset. The unit therefore always gives the neutral form, which recompiles to the same bytes, and the array is declared `char(W) dim(D)` from the fact. Only the declaration can say that the bytes are a subfield (a data structure array with that field at that offset), and that is the declaration stage's decision (`rpg_source_decl_emit.zig`), not the unit's. l3b-ds-var therefore reads `%SUBST(A(I): 5: 9)` of a `char(13) dim(5)` until the declaration stage recovers the data structure. Not in this change: the stores (`65 W; 27 c; 42 A 0 TE`, `65 W; 27 K; 62; ...; 42`), and an integer field read (`65 13; 32 A 0 TE` with a four-byte `TE`), which need the store path and the type of the field. The six captures are adopted as public twins (the matrix rows are classed by the coordinator). ## %SUBST of a part of a data structure passes operation 62 (touches rpg_eval.zig) Five public statements of SC-ILE/EXPERIMENTS h-subfill stopped at `62` with `value_flow` / `stack_value`: `H = %subst(R.c : 2 : 3)`, `%subst(R.c : 1 : 2) = 'ab'`, `H = %subst(ub : 3 : 4)`, `%subst(ub : 2 : 3) = C` and `R.a = %subst(R.c : 3)`. The unit of `rpg_subst_offset.zig` (`27 START; 75 8; 35 T; 33|34 B; 27 T; 27 1; 52; 27 LEN; 75 8; 77 8; 35 N; 62`) did not read two forms of them: - the base address is on the stack before the start is kept (a part of a data structure of the form `33 R; 27 K; 62`): `recoverStacked` reads the eleven operations without the base operation; - the base is `34 B off` with a nonzero offset (`ub`, a subfield of a data structure without a name): `recoverPart` accepts it and checks the range from the offset. `recover` is unchanged for its other caller (`rpg_decimal_call.zig`). `rpg_eval.zig` has the one edit: arm 62 asks `recoverPart`, then `recoverStacked`, for the offset START - 1 of a text start. The fourth and fifth statements pass; `%subst(R.c : 3)` (no length operand) still stops at 62 and is the next shape. Twins: no regression; emit: three statements more (h-subfill and l3b-subst-const). ## Gates ``` {"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"current","emit":{"worse":[],"better":1,"newly_clean":0,"clean_delta":0,"base":322,"new":322},"twins":{"groups":468,"recovered":460,"regressions":[],"newly":6},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/h-subfill/stripped/object.savf 4"],"worse":[]},"full_check":{"exit":0,"seconds":1152}} ```
binjovi-bot manually merged commit 709e928074 into trunk 2026-11-04 12:57:21 +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!715
No description provided.