Compares of character fields of different lengths, and a repeated subfield value #642

Manually merged
binjovi-bot merged 1 commit from rpg-9-ag-padded-fields-20261026 into trunk 2026-10-26 11:08:42 +00:00
Owner

Compares of character fields of different lengths, and a repeated subfield value

A compare of two character fields of N and N + R bytes (blank3 <> high2,
and sub3 <> sub2 of two subfields of one structure) compiles to builtin 17
over N bytes, then a compare of the R bytes after them in the longer field
with blanks through a template, and a result of 1 when either differs. A
rule existed only for a based field against a literal, so the statement
stayed unresolved. The new value unit reads the two-field form and becomes
two loads, the compare and the store of its result. The compares of one
condition reuse the two work temporaries: the unit proves that it writes
them before it reads them and that nothing after it reads them first.

The source emitter takes the width of each end of such a compare
(compareEnds), so a subfield that only a compare names gets its
char(W) declaration, and the end at byte 0 of a structure is that
subfield, not the whole structure.

A character subfield whose initial value repeats one character is
inz(*all'c') when the module keeps no constant of those bytes:
inz('ZZZ') keeps a constant 'ZZZ' beside the initial value of the
structure, and inz(*all'Z') does not (measured by recompiling both).
r5i-figurative is the public reproduction; its emit round-trips to a
match.

Gates

{"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden 173/5/0 == dump 173/5/0","emit":{"worse":[],"better":39,"newly_clean":24,"clean_delta":24,"base":215,"new":239},"twins":{"groups":439,"recovered":431,"regressions":[],"newly":16},"allgroups":{"regressions":[],"newly":["rpg-corpus-captures/files-chain/stripped/object.savf 2","rpg-corpus-captures/files-display-write/stripped/object.savf 2","rpg-corpus-captures/files-logical/stripped/object.savf 2","savf/SC-CONSTRUCT/POINTER/rpg-pointer-procedure-auto/stripped/archive.savf 1","savf/SC-ILE/DSPLY/error-observable/archive.savf 2","savf/SC-ILE/DSPLY/error-stripped/archive.savf 2","savf/SC-ILE/DSPLY/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/d4-edit/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-const/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-input/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-srcstmt-dspf/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7c-copy/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/decimal-fault-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/decimal-sign-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j1/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j2/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j3/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/format-base/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/format-rename/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/gotos-static/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/h-editc/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc5/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc6/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-subind/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/packed-add-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/packed-compose-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/packed-compose-sign-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/r5e-date-field/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5e-editc-held/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5i-figurative/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-reset-ds/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-fixed/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-two/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-full/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-none/stripped/archive.savf 2","savf/SC-ILE/MONITOR/limits-observable/archive.savf 1","savf/SC-ILE/MONITOR/limits-stripped/archive.savf 1","savf/SC-ILE/MONITOR/stripped/archive.savf 2","savf/SC-ILE/TSTRIP-STRIPPED/archive.savf 2","savf/SC-ILE/TSTRIP/archive.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":900}}
# Compares of character fields of different lengths, and a repeated subfield value A compare of two character fields of N and N + R bytes (`blank3 <> high2`, and `sub3 <> sub2` of two subfields of one structure) compiles to builtin 17 over N bytes, then a compare of the R bytes after them in the longer field with blanks through a template, and a result of 1 when either differs. A rule existed only for a based field against a literal, so the statement stayed unresolved. The new value unit reads the two-field form and becomes two loads, the compare and the store of its result. The compares of one condition reuse the two work temporaries: the unit proves that it writes them before it reads them and that nothing after it reads them first. The source emitter takes the width of each end of such a compare (`compareEnds`), so a subfield that only a compare names gets its `char(W)` declaration, and the end at byte 0 of a structure is that subfield, not the whole structure. A character subfield whose initial value repeats one character is `inz(*all'c')` when the module keeps no constant of those bytes: `inz('ZZZ')` keeps a constant 'ZZZ' beside the initial value of the structure, and `inz(*all'Z')` does not (measured by recompiling both). `r5i-figurative` is the public reproduction; its emit round-trips to a match. ## Gates ``` {"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden 173/5/0 == dump 173/5/0","emit":{"worse":[],"better":39,"newly_clean":24,"clean_delta":24,"base":215,"new":239},"twins":{"groups":439,"recovered":431,"regressions":[],"newly":16},"allgroups":{"regressions":[],"newly":["rpg-corpus-captures/files-chain/stripped/object.savf 2","rpg-corpus-captures/files-display-write/stripped/object.savf 2","rpg-corpus-captures/files-logical/stripped/object.savf 2","savf/SC-CONSTRUCT/POINTER/rpg-pointer-procedure-auto/stripped/archive.savf 1","savf/SC-ILE/DSPLY/error-observable/archive.savf 2","savf/SC-ILE/DSPLY/error-stripped/archive.savf 2","savf/SC-ILE/DSPLY/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/d4-edit/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-const/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-out-input/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/d4-srcstmt-dspf/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/d7c-copy/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/decimal-fault-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/decimal-sign-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j1/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j2/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/fmtind-j3/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/format-base/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/format-rename/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/gotos-static/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/h-editc/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc5/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-editc6/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/h-subind/stripped/object.savf 1","savf/SC-ILE/EXPERIMENTS/packed-add-report/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/packed-compose-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/packed-compose-sign-report/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/r5e-date-field/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5e-editc-held/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r5i-figurative/stripped/archive.savf 1","savf/SC-ILE/EXPERIMENTS/r6a-reset-ds/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-fixed/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/r6a-reset-two/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-full/stripped/archive.savf 2","savf/SC-ILE/EXPERIMENTS/shared-io-none/stripped/archive.savf 2","savf/SC-ILE/MONITOR/limits-observable/archive.savf 1","savf/SC-ILE/MONITOR/limits-stripped/archive.savf 1","savf/SC-ILE/MONITOR/stripped/archive.savf 2","savf/SC-ILE/TSTRIP-STRIPPED/archive.savf 2","savf/SC-ILE/TSTRIP/archive.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":900}} ```
Compares of character fields of different lengths
All checks were successful
binjovi/ci Binjovi completed the frozen plan
99166382d2
A compare of two character fields of N and N + R bytes is builtin 17
over N bytes and a compare of the rest of the longer field with blanks.
A value unit reads the two-field form; the emitter takes the width of
each end, and a repeated subfield value is *ALL when the module keeps no
constant of it. r5i-figurative round-trips to a match.
binjovi-bot manually merged commit 99166382d2 into trunk 2026-10-26 11:08:42 +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!642
No description provided.