The whole-structure INZ image store of a local data structure no longer counts as a subfield at byte 0 #808
Loading…
Reference in a new issue
No description provided.
Delete branch "linz"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The whole-structure INZ image store of a local data structure no longer counts as a subfield at byte 0
DCL-DS DataDS QUALIFIED INZ; Num INT(10); Key INT(10); Length INT(10); Data CHAR(20); END-DS;in a procedure or
main()stores its 32 bytes once, in the initialization segment of the procedure(
27 C; 37 S 0 T, T a character of 32 bytes, the length of S).partTypescounted that store as asubfield store at byte 0, so
DataDS.Num = 1(42 S 0 T, an integer) had two types at byte 0 andfailed as
A261.0 = 1 (A261.0: 2 types); the structure was declared withG0 char(4) inz(x'00000000')and lost its INZ. After this change the image store does not clash with aninteger subfield at byte 0, and it gives the type of byte 0 only when nothing else does. dev5/p1
emits
V00261.F0 = 1;anddcl-ds V00261 qualified inz;withF0 int(10); F4 int(10); F8 int(10); F12 char(20);; its failure lines go from 14 to 13.Only
src/core/rpg_source_parts.zigchanges (imageStore,partTypes). The test file issrc/rpg_ds_inz_test.zig(registered insrc/root.zig); the twin isSC-ILE/EXPERIMENTS/linz-p1-chgobjarg (the dev5/p1 capture, MIT source, 119 lines).
What changes across the public twins
Every stripped twin under
src/testdata(1970 programs, before the four battery twins below) was emitted with the binary oftrunk(
fdb37831) and with this branch, and the files compared: exactly two differ.linz-p1-chgobjarg(14 to 13 failure lines, 10 to 11 emitted): the structure above.ldsv-asyncprom(291 to 288 failure lines, 330 to 333 emitted):main()declaresorders likeds(orders_t) inz(count int(10)first),captureErrordeclaresec likeds(errc_t) inz(*likeds)(bytesProv int(10)first). The new lines areF0 int(10); F4 int(10); F8 packed(9:2)withF0 = 3,F4 = 101,F8 = 250(the source'sorders.count = 3; orders.order(1).id = 101; orders.order(1).amount = 250) andF0 int(10); F4 int(10); G8 char(264)withF0 = 272(ec.bytesProv = %size(ec): 4 + 4 + 7 + 1 +256 = 272). The statements and the subfield types agree with the source of the twin; the three structures are still declared without the INZ the source has (the failure lines of that twin that remain belong to other families), and the third declaration is new. This is the second twin of an integer first
subfield under a structure-level INZ.
Every other twin emits byte for byte as before.
The probe pairs, and what each decides
The host answered again at 13:23 on 2026-11-15 and the battery of
requests/linz/ds-inzwascaptured: 15 of 15, 0 dropped (
capture.sh, 1198 s). Each pair differs in the word INZ alone.The four that decide the rule are committed as twins (
linz-f01,linz-f02,linz-g01,linz-g02under SC-ILE/EXPERIMENTS); the others are in~/data/sourcerer-loop/captures/linz-ds-inz.27 C; 37 S 0 Tdcl-ds d qualified (inz)ofint(10) x3, char(20)inmain()END-PROC) ofM; f02: noneA254.0 = 1 (2 types), the DS declaredG0 char(4) inz(x'00000000')without its INZqualified inz,F0 int(10),F0 = 1), 0 failures; f02 unchanged, 0 failuresmain(m)_QRNI_GLOBALstatement 1000001; g02: noneS254.0: 2 typeschar(8)first, thenint(10), local,inzor notW; d02: noneG0 char(8),V00253 = 'abc'ford.c = 'abc'int(10) x2localEND-PROCunresolved in a01 (another family)main(), or in the cycleno declaration of symbol (the initial value has no rule)char(32) inz(*blanks), e02 achar(32)under a structure-level INZ, e03char(8) inz('abc')first in a structure with no structure-level INZWFacts the pairs decide:
that declares it. f01 has it, f02 has none; e03, with the INZ on a subfield only, has a 12-byte one,
the whole structure. It is
27 C; 37 S 0 Twith T the character type of the length of S (32 bytesin f01 and dev5/p1). In dev5/p1 it is
I1160 27 449; I1161 37 261 0 15, in statement 119(
END-PROC,[1102, 1183);rpg_init_layout). The value is the default image of the subfields.d.num = 1is42 S 0 int(10); the othersubfields are addressed (
33 S; 27 K; 62and the stack walk). The image has the type of the wholesymbol, the subfield the type of its own field.
int(10)first subfield only. Captured: f01 and dev5/p1 (int(10)),and
ldsv-asyncprom(orders likeds(orders_t) inz,count int(10);ec likeds(errc_t) inz(*likeds),bytesProv int(10)). When the other access at byte 0 is not an integer,partTypesstill gives two types. d01 and e03 (a character first subfield beside the 12-byte image) emit no two
types before and after, and their emit does not change; why they were spared was not examined.
An
int(3),int(5)orint(20)first subfield is not measured and still gives two types (testwith a retyped p1). Not covered and not refusable yet: an INZ on one subfield beside an
int(10)first subfield (
n int(10); c char(8) inz('abc')with no structure-level INZ). e03 shows that asubfield INZ also makes the whole image, and nothing in the image bytes tells the two apart; it needs
a capture and a round trip. The three
ldsv-asyncpromstructures now declare without the INZ oftheir source; their procedures keep
END-PROC is unresolved(statements 55900, 89700, 159100), andthe test asserts those lines.
initialization procedure (
_QRNI_GLOBAL), which the rule does not read, soS254.0 = 1keeps itstwo types and the declaration keeps
G0 char(4) inz(x'00000000')with the failure line. The pairg01 / g02 is the capture for the next change, which would read that store as the image of a global.
as a
42, a narrower37(char(10)), the37placed outside the final statement of theprocedure, a
37with no constant load before it, and the integer stores of byte 0 retyped as acharacter. Each gives two types at byte 0 as before.
measurement: the test turns every
42of the structure into another operation andpartTypesstill returns the
char(32)of the store. Nothing captured shows thatchar(32) inz(*blanks)compiles to such a store (e01, e02: none beside the field), so no statement is claimed for it.
The round trip, and what was not measured
other families, so it was not recompiled. The round trip of the pair that decides the rule was
measured (
roundtrip.sh, 2026-11-15, pub400, sourcerer 0.1.999): the emit of f01 recompiles to astripped object that matches the stripped twin (
match none, 68 s), and so does the emit of f02(
match none, 65 s).lr1-db-ds-c10-p50-kand others) carry37 S 0 Tstores intheir one procedure, the program entry; the rule asks for the final statement of a subprocedure
(
Module.isSubprocedure, which excludes the cycle main), so none is read as an image. Whether thosestores are whole-width stores of a data structure was not checked. c01 / c02 are unchanged.
do not round trip (
roundtrip.sh:different; d01 and d02 in eight components, e03 in theinstructions, control flow, symbols, constant area and compilation). d02 has no INZ and no image store
and emits the same
V00253 = 'abc'ford.c = 'abc', so the whole-structure assignment of a characterfirst subfield is not caused by the image. a01 emits its structure without INZ
(
END-PROCis unresolved). These belong to other families, with no fix in this change.The rule is that of the final statement of a subprocedure only.
Gate
0f57cc773632b84a9e16