rpg_decimal_convert.zig, rpg_programs.zig, rpg_eval.zig, rpg_source_calls_emit.zig: a decimal argument converted for a CONST packed parameter of a program call #750

Manually merged
binjovi-bot merged 10 commits from lc2j into trunk 2026-11-07 15:12:02 +00:00
Owner

rpg_decimal_convert.zig, rpg_programs.zig, rpg_eval.zig, rpg_source_calls_emit.zig: a decimal argument converted for a CONST packed parameter of a program call

Four public twins stopped at type_inference / operation 75 in the argument setup
of a call to an external program: program-decimal-widen (packed(15:0) to
packed(16:0) const), program-convert (packed(11:3) to packed(9:2) const),
program-packed-field-0 (int(10) to packed(9:0) const) and program-packed-field-2
(int(10) to packed(9:2) const). The call was refused before the frame was
removed; rpg_decimal_copy reads one conversion only, 16 digits to 15 at shift 0.

  • The unit. rpg_decimal_convert.inspect reads, for any packed field of
    FROM digits or a 4-byte integer, 29 F 0 TY; [75 8; 86 20;] 61 TO SHIFT 0; 37 T 0 TP; 33 T; 113 q 1, with the storage, ownership and original-operation
    proof of rpg_argument_copy.storage. The new fact copied_decimal_argument_v1,
    text COPY_REF_DEC(FROM S253 packed(11), TO A291 packed(9), SHIFT -1), states the
    shape and the declared types and nothing else: what the conversion does with an
    invalid value, an overflow or a dropped digit is not measured and is not claimed.
    The fact of the 16-to-15 conversion keeps its text.

  • The source. The shape 61 TO SHIFT 0 compiles from P const with an argument
    whose type has the positions of the parameter less SHIFT. The emitter writes the
    argument and a packed(TO:s) const parameter with s the positions of the field
    plus SHIFT. When no positions are proved and SHIFT drops some (program-convert,
    packed(11:3) to packed(9:2)), the emitter reports the call as a failure
    (the decimal positions of the argument are not proved) and chooses none: a guessed
    number (packed(11:1) inz(1250.0)) has the same init bytes but compiles to another
    literal pool and does not match.

  • The evaluator writes the width of the fact's target, not a fixed 8 bytes.

  • A negative literal (invoke(-42: text), program-packed-held-negative):
    27 K; 86 D; 61 TO SHIFT 0; 37 T 0 TP; 33 T; 113 q 1 with K an integer constant below
    zero. rpg_argument_copy.packedNegative reads it as packedLiteral reads a positive
    one, with the sign nibble D: COPY_REF_PACKED_BYTES(HEX(000004200d), DIGITS 9),
    emitted as INVOKE(-42: ...) with packed(9:2) const.

Emits: program-decimal-widen, program-packed-field-0, program-packed-field-2 and program-packed-held-negative are clean (the first three round-trip to MATCH). program-convert is recovered (COPY_REF_DEC) and its emit fails on the positions.

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":4,"newly_clean":4,"clean_delta":4,"base":419,"new":423},"twins":{"groups":651,"recovered":642,"regressions":[],"newly":0},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/program-convert/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/program-decimal-widen/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/program-packed-field-0/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/program-packed-field-2/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/program-packed-held-negative/stripped/archive.savf 1"],"worse":[]},"full_check":{"exit":0,"seconds":1368}}
## rpg_decimal_convert.zig, rpg_programs.zig, rpg_eval.zig, rpg_source_calls_emit.zig: a decimal argument converted for a CONST packed parameter of a program call Four public twins stopped at type_inference / operation 75 in the argument setup of a call to an external program: program-decimal-widen (packed(15:0) to `packed(16:0) const`), program-convert (packed(11:3) to `packed(9:2) const`), program-packed-field-0 (int(10) to `packed(9:0) const`) and program-packed-field-2 (int(10) to `packed(9:2) const`). The call was refused before the frame was removed; `rpg_decimal_copy` reads one conversion only, 16 digits to 15 at shift 0. - **The unit.** `rpg_decimal_convert.inspect` reads, for any packed field of FROM digits or a 4-byte integer, `29 F 0 TY; [75 8; 86 20;] 61 TO SHIFT 0; 37 T 0 TP; 33 T; 113 q 1`, with the storage, ownership and original-operation proof of `rpg_argument_copy.storage`. The new fact `copied_decimal_argument_v1`, text `COPY_REF_DEC(FROM S253 packed(11), TO A291 packed(9), SHIFT -1)`, states the shape and the declared types and nothing else: what the conversion does with an invalid value, an overflow or a dropped digit is not measured and is not claimed. The fact of the 16-to-15 conversion keeps its text. - **The source.** The shape `61 TO SHIFT 0` compiles from `P const` with an argument whose type has the positions of the parameter less SHIFT. The emitter writes the argument and a `packed(TO:s) const` parameter with s the positions of the field plus SHIFT. When no positions are proved and SHIFT drops some (program-convert, packed(11:3) to packed(9:2)), the emitter reports the call as a failure (`the decimal positions of the argument are not proved`) and chooses none: a guessed number (`packed(11:1) inz(1250.0)`) has the same init bytes but compiles to another literal pool and does not match. - **The evaluator** writes the width of the fact's target, not a fixed 8 bytes. - **A negative literal** (`invoke(-42: text)`, program-packed-held-negative): `27 K; 86 D; 61 TO SHIFT 0; 37 T 0 TP; 33 T; 113 q 1` with K an integer constant below zero. `rpg_argument_copy.packedNegative` reads it as `packedLiteral` reads a positive one, with the sign nibble D: `COPY_REF_PACKED_BYTES(HEX(000004200d), DIGITS 9)`, emitted as `INVOKE(-42: ...)` with `packed(9:2) const`. Emits: program-decimal-widen, program-packed-field-0, program-packed-field-2 and program-packed-held-negative are clean (the first three round-trip to MATCH). program-convert is recovered (`COPY_REF_DEC`) and its emit fails on the positions. ## 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":4,"newly_clean":4,"clean_delta":4,"base":419,"new":423},"twins":{"groups":651,"recovered":642,"regressions":[],"newly":0},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/program-convert/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/program-decimal-widen/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/program-packed-field-0/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/program-packed-field-2/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/program-packed-held-negative/stripped/archive.savf 1"],"worse":[]},"full_check":{"exit":0,"seconds":1368}} ```
sean added 10 commits 2026-11-07 15:02:30 +00:00
binjovi-bot manually merged commit 8f00df95e8 into trunk 2026-11-07 15:12:02 +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!750
No description provided.