rpg_decimal_convert.zig, rpg_programs.zig, rpg_source_calls_emit.zig: a computed value copied to a CONST packed parameter of a program call #753

Manually merged
binjovi-bot merged 3 commits from lc2l into trunk 2026-11-07 16:54:07 +00:00
Owner

rpg_decimal_convert.zig, rpg_programs.zig, rpg_source_calls_emit.zig: a computed value copied to a CONST packed parameter of a program call

Four captures (lc2-arg-expr-add p92 + p72, lc2-arg-expr-mul i10 * 2, lc2-arg-uns5 and
lc2-arg-uns10 u5, each to packed(9:2) const) stopped at type_inference / operation 75 in the
argument setup. The copy of the argument is not one field read and converted
(29 F 0 T; 61 ..., rpg_decimal_convert.inspectLength) but a value that loads, conversions and
arithmetic build:

29 270 0 10; 29 269 0 11; 54 10 0 0; 61 9 0 0; 37 312 0 10; 33 312; 113 39 1    (p92 + p72)
29 262 0 2; 75 8; 75 8; 27 435; 75 8; 51; 86 20; 61 9 2 0; 37 ...                   (i10 * 2)
29 273 0 10; 76 8; 88 20; 61 9 2 0; 37 ...                                          (u5)
  • rpg_decimal_convert.computed finds the value backward from the shift: its operations leave one
    value on the stack, are at most 24, and are loads (27, 29), conversions (75, 76, 84, 86, 87, 88) or
    arithmetic (47, 51, 52, 54). The storage, ownership and original-operation proof is that of the other
    readers. The operations stay in the body: the evaluator builds the text of the value.
  • The fact is copied_decimal_argument_v1 with computed, text COPY_REF_VALUE(TO A291 packed(9), SHIFT 2).
    The argument shows as COPY_REF_VALUE(S270 + S269, TO packed(9), SHIFT 0): the text of the
    value the evaluator built, the digits and the shift. No exception or truncation is stated.
  • The emitter writes the value as an expression and a packed(M:s) const parameter whose positions are
    those of the value (integers none, a sum the larger, a product the sum; a field of unproved positions
    leaves them unproved) plus the shift. The arguments of a call are split at : outside parentheses.

Statement 39 of the four captures is recovered; invoke(i10 * 2: text) emits INVOKE(INVOKE_00262 * 2: ...) with
*n packed(9:2) const, u5 emits *n packed(9:2) const. The sum has unproved positions (placeholders, 0 assumed).
The *inlr = *on of these programs (statement 40) stops at remaining effects of the procedure: the
static initialization of the data structure and the array that the battery declares; not read here.

A value of a literal and one conversion (27 K; 86 D; 61 ...) is not read as a computed value: the
packed literal readers own that form and refuse its malformed operands, and rpg_packed_copy_test
pins those refusals.

ROUND9 summary of lane Lc2

Shipped as public gains, stacked in order: lc2j (PR 750, decimal conversions of a program-call
argument), lc2k (PR 752, a character field copied to a larger CONST character parameter) and this
change (a computed value copied to a CONST packed parameter).

Rules in the lane, by construct: the %INT(%TRIM) condition; element index, part and store, and
subfield arrays; %DEC, %INT and %SCAN of an element; trim and concatenation of elements; calls
with a CONST buffer and shared imports; varying concatenation; character literal and field CONST
arguments; decimal conversions and negative literals; computed values to a packed CONST parameter.

Held-out result: unchanged. A source was read by mistake and reported; nothing from it was used.

Open, not done: %SCAN(%TRIM) (dict sv4..14), dict-calls2 statements 72 and 76, a varying target of
a concatenation, a post-call varying block (return-concat), the static initialization at *inlr = *on
of the program-args captures, the float conversion (op 97) of a program-call argument, %CHECK,
%REPLACE, %SCANRPL, %UPPER, %LOOKUP, %SQRT and dsply. Decimal positions that the object
does not prove stay unproved.

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":"regenerated","emit":{"worse":[],"better":0,"newly_clean":0,"clean_delta":0,"base":428,"new":428},"twins":{"groups":658,"recovered":645,"regressions":[],"newly":1},"allgroups":{"regressions":[],"newly":[],"worse":[]},"full_check":{"exit":0,"seconds":913}}
## rpg_decimal_convert.zig, rpg_programs.zig, rpg_source_calls_emit.zig: a computed value copied to a CONST packed parameter of a program call Four captures (lc2-arg-expr-add `p92 + p72`, lc2-arg-expr-mul `i10 * 2`, lc2-arg-uns5 and lc2-arg-uns10 `u5`, each to `packed(9:2) const`) stopped at type_inference / operation 75 in the argument setup. The copy of the argument is not one field read and converted (`29 F 0 T; 61 ...`, `rpg_decimal_convert.inspectLength`) but a value that loads, conversions and arithmetic build: 29 270 0 10; 29 269 0 11; 54 10 0 0; 61 9 0 0; 37 312 0 10; 33 312; 113 39 1 (p92 + p72) 29 262 0 2; 75 8; 75 8; 27 435; 75 8; 51; 86 20; 61 9 2 0; 37 ... (i10 * 2) 29 273 0 10; 76 8; 88 20; 61 9 2 0; 37 ... (u5) - `rpg_decimal_convert.computed` finds the value backward from the shift: its operations leave one value on the stack, are at most 24, and are loads (27, 29), conversions (75, 76, 84, 86, 87, 88) or arithmetic (47, 51, 52, 54). The storage, ownership and original-operation proof is that of the other readers. The operations stay in the body: the evaluator builds the text of the value. - The fact is `copied_decimal_argument_v1` with `computed`, text `COPY_REF_VALUE(TO A291 packed(9), SHIFT 2)`. The argument shows as `COPY_REF_VALUE(S270 + S269, TO packed(9), SHIFT 0)`: the text of the value the evaluator built, the digits and the shift. No exception or truncation is stated. - The emitter writes the value as an expression and a `packed(M:s) const` parameter whose positions are those of the value (integers none, a sum the larger, a product the sum; a field of unproved positions leaves them unproved) plus the shift. The arguments of a call are split at `: ` outside parentheses. Statement 39 of the four captures is recovered; `invoke(i10 * 2: text)` emits `INVOKE(INVOKE_00262 * 2: ...)` with `*n packed(9:2) const`, `u5` emits `*n packed(9:2) const`. The sum has unproved positions (placeholders, 0 assumed). The `*inlr = *on` of these programs (statement 40) stops at remaining effects of the procedure: the static initialization of the data structure and the array that the battery declares; not read here. A value of a literal and one conversion (`27 K; 86 D; 61 ...`) is not read as a computed value: the packed literal readers own that form and refuse its malformed operands, and `rpg_packed_copy_test` pins those refusals. ## ROUND9 summary of lane Lc2 Shipped as public gains, stacked in order: lc2j (PR 750, decimal conversions of a program-call argument), lc2k (PR 752, a character field copied to a larger CONST character parameter) and this change (a computed value copied to a CONST packed parameter). Rules in the lane, by construct: the `%INT(%TRIM)` condition; element index, part and store, and subfield arrays; `%DEC`, `%INT` and `%SCAN` of an element; trim and concatenation of elements; calls with a CONST buffer and shared imports; varying concatenation; character literal and field CONST arguments; decimal conversions and negative literals; computed values to a packed CONST parameter. Held-out result: unchanged. A source was read by mistake and reported; nothing from it was used. Open, not done: `%SCAN(%TRIM)` (dict sv4..14), dict-calls2 statements 72 and 76, a varying target of a concatenation, a post-call varying block (return-concat), the static initialization at `*inlr = *on` of the program-args captures, the float conversion (op 97) of a program-call argument, `%CHECK`, `%REPLACE`, `%SCANRPL`, `%UPPER`, `%LOOKUP`, `%SQRT` and `dsply`. Decimal positions that the object does not prove stay unproved. ## 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":"regenerated","emit":{"worse":[],"better":0,"newly_clean":0,"clean_delta":0,"base":428,"new":428},"twins":{"groups":658,"recovered":645,"regressions":[],"newly":1},"allgroups":{"regressions":[],"newly":[],"worse":[]},"full_check":{"exit":0,"seconds":913}} ```
binjovi-bot manually merged commit 9fd8ebf578 into trunk 2026-11-07 16:54:07 +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!753
No description provided.