rpg_eval.zig: a condition on %INT or %DEC of a character value recovers #742

Manually merged
binjovi-bot merged 1 commit from lc2 into trunk 2026-11-07 08:23:31 +00:00
Owner

rpg_eval.zig: a condition on %INT or %DEC of a character value recovers

if %int(%trim(parm)) > 3 (SC-ILE/EXPERIMENTS h-numtrim statement 13) stopped
at control_flow / operation_semantics on operation 15, the first label of the
inlined trim loop. The label was not the cause. rpg_trim.argumentUnit and
rpg_decimal_call.zig read the whole condition, but the proved
_QRNX_GET_DECIMAL_NUM call of the conversion left one fact line on the
evaluator, and a condition refused any line. runValues then fell back to the
raw operations and step reported the loop's head label.

The evaluator now counts the fact lines that are that call (decimal_lines).
A condition accepts exactly those lines; the fact stays in the statement's
evidence and the condition text is the comparison. Any other line (a time or
date call, an edit call, a store) still refuses the condition. The same
assignment, s256 = %int(%trim(parm)), already showed the call as evidence
and not as source.

Why the other statements named for the lane stop at operation 15 (no change
here): each is a built-in whose inlined expansion holds a loop or a bounds
check that no rewriter in runValues consumes.

  • %CHAR of an integer (zoned convert, leading-zero and sign strip loop):
    d4-edit 14, h-editc 44, h-now1 53. No value unit reads that expansion.
  • %INT of %TRIM of a varying field, of %TRIML, of %TRIMR (dict-numtrim
    31, 35, 43): rpg_trim.argumentUnit takes .both loops over a fixed field
    or a pointer only.
  • Two %TRIM values concatenated into a character field (d4-lemon-battery 24),
    %TRIM(C) + 'x' into a varying field and %TRIM(C) <> '' (h-bifs-char 42,
    44): the loop temporaries P and N are consumed by a copy that no unit reads.
  • %SUBST with a variable start, %REPLACE, %LEFT, %RIGHT, %CHECK,
    %CHECKR (h-bifs-char 23, 25, 29, 30, 33, 34): each its own range check.
  • %LOOKUP (dict-arrays-a-a 18, 19), %SQRT (dict-bifs-num-b 19).
  • A(I5) with i5 int(5) (dict-arrays-b-b 19): the unit of
    rpg_array_element.zig takes a four-byte integer index only. Widening
    integerField to a two-byte index recovers the statement; it is outside this
    lane's files and has no committed twin.

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":5,"newly_clean":21,"clean_delta":21,"base":394,"new":415},"twins":{"groups":586,"recovered":578,"regressions":[],"newly":16},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/h-numtrim/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk3/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5-sub/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-zd4/stripped/object.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":941}}
## rpg_eval.zig: a condition on %INT or %DEC of a character value recovers `if %int(%trim(parm)) > 3` (SC-ILE/EXPERIMENTS h-numtrim statement 13) stopped at control_flow / operation_semantics on operation 15, the first label of the inlined trim loop. The label was not the cause. `rpg_trim.argumentUnit` and `rpg_decimal_call.zig` read the whole condition, but the proved `_QRNX_GET_DECIMAL_NUM` call of the conversion left one fact line on the evaluator, and a condition refused any line. `runValues` then fell back to the raw operations and `step` reported the loop's head label. The evaluator now counts the fact lines that are that call (`decimal_lines`). A condition accepts exactly those lines; the fact stays in the statement's evidence and the condition text is the comparison. Any other line (a time or date call, an edit call, a store) still refuses the condition. The same assignment, `s256 = %int(%trim(parm))`, already showed the call as evidence and not as source. Why the other statements named for the lane stop at operation 15 (no change here): each is a built-in whose inlined expansion holds a loop or a bounds check that no rewriter in `runValues` consumes. - `%CHAR` of an integer (zoned convert, leading-zero and sign strip loop): d4-edit 14, h-editc 44, h-now1 53. No value unit reads that expansion. - `%INT` of `%TRIM` of a varying field, of `%TRIML`, of `%TRIMR` (dict-numtrim 31, 35, 43): `rpg_trim.argumentUnit` takes `.both` loops over a fixed field or a pointer only. - Two `%TRIM` values concatenated into a character field (d4-lemon-battery 24), `%TRIM(C) + 'x'` into a varying field and `%TRIM(C) <> ''` (h-bifs-char 42, 44): the loop temporaries P and N are consumed by a copy that no unit reads. - `%SUBST` with a variable start, `%REPLACE`, `%LEFT`, `%RIGHT`, `%CHECK`, `%CHECKR` (h-bifs-char 23, 25, 29, 30, 33, 34): each its own range check. - `%LOOKUP` (dict-arrays-a-a 18, 19), `%SQRT` (dict-bifs-num-b 19). - `A(I5)` with `i5 int(5)` (dict-arrays-b-b 19): the unit of `rpg_array_element.zig` takes a four-byte integer index only. Widening `integerField` to a two-byte index recovers the statement; it is outside this lane's files and has no committed twin. ## 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":5,"newly_clean":21,"clean_delta":21,"base":394,"new":415},"twins":{"groups":586,"recovered":578,"regressions":[],"newly":16},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/h-numtrim/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk3/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5-sub/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-zd4/stripped/object.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":941}} ```
rpg_eval.zig: a condition on %INT or %DEC of a character value recovers
All checks were successful
binjovi/ci Binjovi completed the frozen plan
3c1b70c854
binjovi-bot manually merged commit 3c1b70c854 into trunk 2026-11-07 08:23:31 +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!742
No description provided.