Elements of numeric arrays compile again (touches rpg_source.zig) #735

Manually merged
binjovi-bot merged 1 commit from lr1-num-elem into trunk 2026-11-05 20:10:58 +00:00
Owner

Elements of numeric arrays compile again (touches rpg_source.zig)

Since v0.1.433 the emitted source of a program that does arithmetic on
elements of numeric arrays (x = a(i) - b(j), x = y + a(i) * z,
a(i) = a(i) + 1) failed to compile with RNF7421. The ship gates count emit
failures, not compiles. Seven public twins (SC-ILE/EXPERIMENTS lr1-num-*:
packed(7:2), zoned(5:0) and int(10), standalone dim and DS subfield
arrays) now pin it.

Two causes:

  • A numeric load at byte 0 of a character symbol that is wider than the load
    (the first subfield of a data structure, the first element of an array) was
    written with the name of the symbol, so the data structure was an operand
    (A_00255 - A_00255.F28). rpg_eval.zig writes it as S255.0.
  • An array that the statements index was declared only when its elements were
    characters, and two elements in one statement were not a unit: the compiler
    computes both element addresses, then swaps and loads, and it reuses one
    temporary. rpg_array_element.zig reads the address alone (pendingAddress)
    and lets units share the temporary; the element store takes any element type;
    rpg_source_decl_emit.zig declares packed(d:s), zoned(d:s) and int(n)
    arrays, with no INZ clause for the default value; the assignment accepts an
    element target a(i) = ....

Not done: the decimal positions of a packed array are not proved (the array is
packed(7:0)), and a variable index into an array that is a subfield of a data
structure is not a unit.

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":14,"clean_delta":14,"base":359,"new":373},"twins":{"groups":540,"recovered":532,"regressions":[],"newly":21},"allgroups":{"regressions":[],"newly":[],"worse":[]},"full_check":{"exit":0,"seconds":743}}
# Elements of numeric arrays compile again (touches rpg_source.zig) Since v0.1.433 the emitted source of a program that does arithmetic on elements of numeric arrays (`x = a(i) - b(j)`, `x = y + a(i) * z`, `a(i) = a(i) + 1`) failed to compile with RNF7421. The ship gates count emit failures, not compiles. Seven public twins (SC-ILE/EXPERIMENTS `lr1-num-*`: packed(7:2), zoned(5:0) and int(10), standalone `dim` and DS subfield arrays) now pin it. Two causes: - A numeric load at byte 0 of a character symbol that is wider than the load (the first subfield of a data structure, the first element of an array) was written with the name of the symbol, so the data structure was an operand (`A_00255 - A_00255.F28`). `rpg_eval.zig` writes it as `S255.0`. - An array that the statements index was declared only when its elements were characters, and two elements in one statement were not a unit: the compiler computes both element addresses, then swaps and loads, and it reuses one temporary. `rpg_array_element.zig` reads the address alone (`pendingAddress`) and lets units share the temporary; the element store takes any element type; `rpg_source_decl_emit.zig` declares `packed(d:s)`, `zoned(d:s)` and `int(n)` arrays, with no INZ clause for the default value; the assignment accepts an element target `a(i) = ...`. Not done: the decimal positions of a packed array are not proved (the array is `packed(7:0)`), and a variable index into an array that is a subfield of a data structure is not a unit. ## 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":14,"clean_delta":14,"base":359,"new":373},"twins":{"groups":540,"recovered":532,"regressions":[],"newly":21},"allgroups":{"regressions":[],"newly":[],"worse":[]},"full_check":{"exit":0,"seconds":743}} ```
Elements of numeric arrays compile again (touches rpg_source.zig)
All checks were successful
binjovi/ci Binjovi completed the frozen plan
0f7fe98ef4
sean force-pushed lr1-num-elem from 0f7fe98ef4
All checks were successful
binjovi/ci Binjovi completed the frozen plan
to 8206fe12be
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-05 17:30:20 +00:00
Compare
sean force-pushed lr1-num-elem from 8206fe12be
All checks were successful
binjovi/ci Binjovi completed the frozen plan
to a331786f89
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-05 20:01:02 +00:00
Compare
binjovi-bot manually merged commit a331786f89 into trunk 2026-11-05 20:10:58 +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!735
No description provided.