A plain DSPLY of one operand in a procedure recovers (_QRNX_DSPLY_SUBP) #802

Manually merged
binjovi-bot merged 2 commits from ldsp into trunk 2026-11-14 16:42:32 +00:00
Owner

A plain DSPLY of one operand in a procedure recovers (_QRNX_DSPLY_SUBP)

rpg_display.recover reads the call of _QRNX_DSPLY_SUBP that a procedure makes for DSPLY msg,
DSPLY msg queue and DSPLY msg queue response. The group is the 20-operation build of the mainline
call (three 48-byte descriptors, 33 d1; 33 d2; 33 d3; 33 ctx; 99 entry 4 0 0; 3) with two
differences that the battery measured (SC-ILE/EXPERIMENTS ldsp-sp-*, request
requests/ldsp/dsply-subp, 24 cases):

  • The fourth argument is the display context of the procedure, an automatic structure (kind 8, class
    4, owner the procedure, 192 bytes, flags f8008000), not the static one of the cycle main. It is not
    made by the DSPLY: the procedure without a DSPLY (ldsp-sp-none) owns the same symbol, and its
    epilogue (the statement of END-PROC) sets its fields.
  • The procedure is a called one (symbol class 3), the one of a main(p) module (class 3 too, no cycle
    main) or an exported one (class 1 that is not the cycle main). Module.isSubprocedure names all
    three. The cycle main calls _QRNX_DSPLY with the static context and keeps its reader; a module that
    has both calls (ldsp-sp-both) imports both entries, and each reader takes the group that names its
    own entry.

displayRuntime hands the reader both entries (Runtime.subp, 0 when the module lacks it) and the return
label of the procedure (Runtime.exit). recoverSub accepts the message as a literal, a local field
(class 4, owner the procedure, flags 70008000), a static field (class 3, 7000c000) or a static data
structure addressed before the descriptors (33 DS); the queue and response operands are fields of the
same kinds. It refuses a varying message (the length guard of a procedure calls the soft-error entry with
two arguments, 27 K; 33 ctx; 5; 99 soft 2 0 0, not the mainline guard), a pointer or parameter message
(29 x 0 T: a based field or a const reference, which need a name that the object lacks), an expression,
and every group that holds an operation more than the measured ones.

The tail of a group is read as structure, not as an effect: the labels that the blocks around the DSPLY
define (15 L k), after at most one jump 18 T. The jump may go to the label that follows it at once
(the end of the procedure, 18 7; 15 7 2 in ldsp-sp-last), or over an ELSE or back to a loop head; a
jump to the return label of the procedure that is not the next operation is a RETURN and refuses. The
block lines (IF, ELSE, ENDIF) are written by the block machinery from the same jump, as for any statement.

The wrapper 106 R; 108; ... 107 R; 108 of the 106/107 question: it is in the object of the DSPLY of a
procedure that has a MONITOR group, in the statements before, in and after the group and in the ON-ERROR
block (ldsp-sp-mon-before, -after, -in, -onerr); a procedure with an ON-EXIT section and no MONITOR
(ldsp-sp-onexit) has none. The wrapped call is still _QRNX_DSPLY_SUBP; the module imports
_QRNX_SUBP_DSPLY_MON (never called) with a MONITOR and _QRNX_SUBP_ON_EXIT_CNL_H (never called) with an
ON-EXIT. The operations 106 to 109, 111 and 6 are frame operations that the shape drops before any
reader (rpg_loop_exits.frame_operations), so the DSPLY reader needs no rule for the wrapper. A DSPLY in
the monitored body keeps its tail of the monitor (29 s 0 2; 27 K; 78 4; 52; 37 s 0 2; 18 L; 15 L 2):
it refuses (ldsp-sp-mon-in), as before.

Emitter.statement of rpg_source.zig split the operands of dsply at every blank, so a literal with
a blank ('Last timestamp: ') failed with literal without its end. rpg_display.nextOperand splits at
the blanks outside a quoted literal (a doubled quote stays in it).

Measured

Stripped twins of the 32 public scout programs (captures/l10-scout2, l10-scout2b: 33 directories, one
program is in both trees and counted once), base 43ab0ba1 against this build, capture-emit-diff.sh:
statements 512, emitted 273 to 284, failure lines 246 to 235. agree.sh over them: 9 more statements that
equal their source, suspect 13 to 13, wrong parameters 0 to 0; emit-lint.sh: 0 findings. Four programs
change:

program emitted failures the DSPLY statements that recover
ossile-2 8 to 13 7 to 2 5 of 5 (local char(50))
advent day 1 27 to 29 18 to 16 2 of 2 (local char(50); the declaration of the field appears)
ossile-3 7 to 10 11 to 8 3 of 3 (two literals with blanks, a data area subfield)
barrett ifsread 8 to 9 22 to 21 1 of 2 (dsply ('Could not open file')); the DSPLY in ON-ERROR reads as DSPLY 'Fatal error occurred reading file.' and keeps its MONITOR failure line

The battery, its 24 stripped twins: the failure lines fall in 16 cases, and 8 cases that had a failure line
emit without one (loc, static, literal, queue, ds-sub, last, export, both); the none control stays clean
and no case has a new failure line.

case before after
loc, static, literal, queue, ds-sub, last, export, both 1 failure 0
main-loc, main-literal 2 1 (the compiler statement 2100000001 of the main procedure)
if-return, if-else, mon-before, mon-after, mon-onerr, onexit DSPLY failure DSPLY recovers; the failures of the IF, ELSE, MONITOR or ON-EXIT remain
mon-in, varying, based, based-set, based-two, main-based, p-both refused refused (see limits)

Limits, not done

  • A char field through a pointer (based(ptr), 8 of the 20 statements: ossile-5 and 6): the message is
    29 ptr 0 T and the width a constant; the field has a symbol of class 0 that no statement names, so
    firstName and fullName differ only by the width. Naming it needs a declaration pass in the source
    layer (dcl-s F char(10) based(P)), which is the next change. The reader refuses it.
  • A const reference parameter or a value parameter as the message (ldsp-sp-p-both: 29 param 0 T and
    34 sym 0 of the copy) and a varying message refuse.
  • A DSPLY in the monitored body refuses (tail of the monitor); the same for DSPLY(E), which no case holds.
  • rpg_runtime.zig lists _QRNX_DSPLY_SUBP with 1 argument and TRPG3 as evidence; the call has 4
    operands. The row is not changed here.

Probes

  • ldsp-sp-loc, ldsp-sp-static, ldsp-sp-literal, ldsp-sp-queue, ldsp-sp-ds-sub, ldsp-sp-last,
    ldsp-sp-export, ldsp-sp-both: clean emits.
    Not adopted: ldsp-sp-main-loc and -main-literal (the procedure of a main(p) module): the DSPLY recovers
    (failures 2 to 1 in each), but the emit keeps the compiler statement 2100000001 is partial failure of the
    main procedure, which this change does not touch, so the twins would be non-matching rows. The reader gate
    for them is the class-3 gate that ldsp-sp-loc proves (Module.isSubprocedure). The captures are in
    captures/ldsp-dsply-subp.

New tests: src/rpg_dsply_subp_test.zig.

Gate (host round trips, base ~/bin/sourcerer v0.1.517)

ldsp-sp-queue base=[7,6,1] head=[7,7,0] CHANGED fail-lines=0
ldsp-sp-static base=[7,6,1] head=[7,7,0] CHANGED fail-lines=0
capture-emit-diff: 68 cases, 20 changed, 15 with no failure line in the head emit
== e. source agreement (agree)
suspect        base=92 head=92
conflict       base=0 head=0
params_wrong   base=15 head=15
decl_missing   base=86 head=86
decl_extra     base=28 head=28
type_unmarked  base=50 head=50
== f. host round trips (both binaries)
cases to round-trip: 17
dev5/p3                                            base=different head=different
dev5/p4                                            base=different head=different
dev5/p5                                            base=match head=match
l10-scout2b/l10-danlong005-openrpg/l10-danlong005-openrpg-1 base=match head=match
l10-scout2b/l10-danlong005-openrpg/l10-danlong005-openrpg-4 base=match head=match
l10-scout2b/l10-danlong005-openrpg/l10-danlong005-openrpg-5 base=match head=match
ldsp-dsply-subp/ldsp-sp-both                       base=different head=match
ldsp-dsply-subp/ldsp-sp-ds-sub                     base=different head=different
ldsp-dsply-subp/ldsp-sp-export                     base=different head=match
ldsp-dsply-subp/ldsp-sp-last                       base=different head=match
ldsp-dsply-subp/ldsp-sp-literal                    base=different head=match
ldsp-dsply-subp/ldsp-sp-loc                        base=different head=match
ldsp-dsply-subp/ldsp-sp-main-literal               base=different head=match
ldsp-dsply-subp/ldsp-sp-main-loc                   base=different head=match
ldsp-dsply-subp/ldsp-sp-none                       base=match head=match
ldsp-dsply-subp/ldsp-sp-queue                      base=different head=match
ldsp-dsply-subp/ldsp-sp-static                     base=different head=match
gate: PASS
# A plain DSPLY of one operand in a procedure recovers (`_QRNX_DSPLY_SUBP`) `rpg_display.recover` reads the call of `_QRNX_DSPLY_SUBP` that a procedure makes for `DSPLY msg`, `DSPLY msg queue` and `DSPLY msg queue response`. The group is the 20-operation build of the mainline call (three 48-byte descriptors, `33 d1; 33 d2; 33 d3; 33 ctx; 99 entry 4 0 0; 3`) with two differences that the battery measured (SC-ILE/EXPERIMENTS `ldsp-sp-*`, request `requests/ldsp/dsply-subp`, 24 cases): - The fourth argument is the display context of the procedure, an automatic structure (kind 8, class 4, owner the procedure, 192 bytes, flags `f8008000`), not the static one of the cycle main. It is not made by the DSPLY: the procedure without a DSPLY (`ldsp-sp-none`) owns the same symbol, and its epilogue (the statement of END-PROC) sets its fields. - The procedure is a called one (symbol class 3), the one of a `main(p)` module (class 3 too, no cycle main) or an exported one (class 1 that is not the cycle main). `Module.isSubprocedure` names all three. The cycle main calls `_QRNX_DSPLY` with the static context and keeps its reader; a module that has both calls (`ldsp-sp-both`) imports both entries, and each reader takes the group that names its own entry. `displayRuntime` hands the reader both entries (`Runtime.subp`, 0 when the module lacks it) and the return label of the procedure (`Runtime.exit`). `recoverSub` accepts the message as a literal, a local field (class 4, owner the procedure, flags `70008000`), a static field (class 3, `7000c000`) or a static data structure addressed before the descriptors (`33 DS`); the queue and response operands are fields of the same kinds. It refuses a varying message (the length guard of a procedure calls the soft-error entry with two arguments, `27 K; 33 ctx; 5; 99 soft 2 0 0`, not the mainline guard), a pointer or parameter message (`29 x 0 T`: a based field or a const reference, which need a name that the object lacks), an expression, and every group that holds an operation more than the measured ones. The tail of a group is read as structure, not as an effect: the labels that the blocks around the DSPLY define (`15 L k`), after at most one jump `18 T`. The jump may go to the label that follows it at once (the end of the procedure, `18 7; 15 7 2` in `ldsp-sp-last`), or over an ELSE or back to a loop head; a jump to the return label of the procedure that is not the next operation is a RETURN and refuses. The block lines (IF, ELSE, ENDIF) are written by the block machinery from the same jump, as for any statement. The wrapper `106 R; 108; ... 107 R; 108` of the 106/107 question: it is in the object of the DSPLY of a procedure that has a MONITOR group, in the statements before, in and after the group and in the ON-ERROR block (`ldsp-sp-mon-before`, `-after`, `-in`, `-onerr`); a procedure with an ON-EXIT section and no MONITOR (`ldsp-sp-onexit`) has none. The wrapped call is still `_QRNX_DSPLY_SUBP`; the module imports `_QRNX_SUBP_DSPLY_MON` (never called) with a MONITOR and `_QRNX_SUBP_ON_EXIT_CNL_H` (never called) with an ON-EXIT. The operations 106 to 109, 111 and 6 are frame operations that the shape drops before any reader (`rpg_loop_exits.frame_operations`), so the DSPLY reader needs no rule for the wrapper. A DSPLY in the monitored body keeps its tail of the monitor (`29 s 0 2; 27 K; 78 4; 52; 37 s 0 2; 18 L; 15 L 2`): it refuses (`ldsp-sp-mon-in`), as before. `Emitter.statement` of `rpg_source.zig` split the operands of `dsply` at every blank, so a literal with a blank (`'Last timestamp: '`) failed with `literal without its end`. `rpg_display.nextOperand` splits at the blanks outside a quoted literal (a doubled quote stays in it). ## Measured Stripped twins of the 32 public scout programs (`captures/l10-scout2`, `l10-scout2b`: 33 directories, one program is in both trees and counted once), base 43ab0ba1 against this build, `capture-emit-diff.sh`: statements 512, emitted 273 to 284, failure lines 246 to 235. `agree.sh` over them: 9 more statements that equal their source, suspect 13 to 13, wrong parameters 0 to 0; `emit-lint.sh`: 0 findings. Four programs change: | program | emitted | failures | the DSPLY statements that recover | |---|---|---|---| | ossile-2 | 8 to 13 | 7 to 2 | 5 of 5 (local `char(50)`) | | advent day 1 | 27 to 29 | 18 to 16 | 2 of 2 (local `char(50)`; the declaration of the field appears) | | ossile-3 | 7 to 10 | 11 to 8 | 3 of 3 (two literals with blanks, a data area subfield) | | barrett ifsread | 8 to 9 | 22 to 21 | 1 of 2 (`dsply ('Could not open file')`); the DSPLY in ON-ERROR reads as `DSPLY 'Fatal error occurred reading file.'` and keeps its MONITOR failure line | The battery, its 24 stripped twins: the failure lines fall in 16 cases, and 8 cases that had a failure line emit without one (loc, static, literal, queue, ds-sub, last, export, both); the `none` control stays clean and no case has a new failure line. | case | before | after | |---|---|---| | loc, static, literal, queue, ds-sub, last, export, both | 1 failure | 0 | | main-loc, main-literal | 2 | 1 (the `compiler statement 2100000001` of the main procedure) | | if-return, if-else, mon-before, mon-after, mon-onerr, onexit | DSPLY failure | DSPLY recovers; the failures of the IF, ELSE, MONITOR or ON-EXIT remain | | mon-in, varying, based, based-set, based-two, main-based, p-both | refused | refused (see limits) | ## Limits, not done - A char field through a pointer (`based(ptr)`, 8 of the 20 statements: ossile-5 and 6): the message is `29 ptr 0 T` and the width a constant; the field has a symbol of class 0 that no statement names, so `firstName` and `fullName` differ only by the width. Naming it needs a declaration pass in the source layer (`dcl-s F char(10) based(P)`), which is the next change. The reader refuses it. - A const reference parameter or a value parameter as the message (`ldsp-sp-p-both`: `29 param 0 T` and `34 sym 0` of the copy) and a varying message refuse. - A DSPLY in the monitored body refuses (tail of the monitor); the same for `DSPLY(E)`, which no case holds. - `rpg_runtime.zig` lists `_QRNX_DSPLY_SUBP` with 1 argument and TRPG3 as evidence; the call has 4 operands. The row is not changed here. ## Probes - `ldsp-sp-loc`, `ldsp-sp-static`, `ldsp-sp-literal`, `ldsp-sp-queue`, `ldsp-sp-ds-sub`, `ldsp-sp-last`, `ldsp-sp-export`, `ldsp-sp-both`: clean emits. Not adopted: `ldsp-sp-main-loc` and `-main-literal` (the procedure of a `main(p)` module): the DSPLY recovers (failures 2 to 1 in each), but the emit keeps the `compiler statement 2100000001 is partial` failure of the main procedure, which this change does not touch, so the twins would be non-matching rows. The reader gate for them is the class-3 gate that `ldsp-sp-loc` proves (`Module.isSubprocedure`). The captures are in `captures/ldsp-dsply-subp`. New tests: `src/rpg_dsply_subp_test.zig`. ## Gate (host round trips, base ~/bin/sourcerer v0.1.517) ``` ldsp-sp-queue base=[7,6,1] head=[7,7,0] CHANGED fail-lines=0 ldsp-sp-static base=[7,6,1] head=[7,7,0] CHANGED fail-lines=0 capture-emit-diff: 68 cases, 20 changed, 15 with no failure line in the head emit == e. source agreement (agree) suspect base=92 head=92 conflict base=0 head=0 params_wrong base=15 head=15 decl_missing base=86 head=86 decl_extra base=28 head=28 type_unmarked base=50 head=50 == f. host round trips (both binaries) cases to round-trip: 17 dev5/p3 base=different head=different dev5/p4 base=different head=different dev5/p5 base=match head=match l10-scout2b/l10-danlong005-openrpg/l10-danlong005-openrpg-1 base=match head=match l10-scout2b/l10-danlong005-openrpg/l10-danlong005-openrpg-4 base=match head=match l10-scout2b/l10-danlong005-openrpg/l10-danlong005-openrpg-5 base=match head=match ldsp-dsply-subp/ldsp-sp-both base=different head=match ldsp-dsply-subp/ldsp-sp-ds-sub base=different head=different ldsp-dsply-subp/ldsp-sp-export base=different head=match ldsp-dsply-subp/ldsp-sp-last base=different head=match ldsp-dsply-subp/ldsp-sp-literal base=different head=match ldsp-dsply-subp/ldsp-sp-loc base=different head=match ldsp-dsply-subp/ldsp-sp-main-literal base=different head=match ldsp-dsply-subp/ldsp-sp-main-loc base=different head=match ldsp-dsply-subp/ldsp-sp-none base=match head=match ldsp-dsply-subp/ldsp-sp-queue base=different head=match ldsp-dsply-subp/ldsp-sp-static base=different head=match gate: PASS ```
A procedure calls _QRNX_DSPLY_SUBP with the 192-byte display context that it
owns. rpg_display.recoverSub reads the message as a literal, a local or static
character field or a field of a static data structure, with the queue and
response operands, in a called, exported or main(p) procedure. The tail may be
the jump to the next label or over an ELSE. A varying message, a pointer or a
parameter message and a DSPLY in a monitored body refuse.

The DSPLY emit splits its operands outside quoted literals, so a literal with a
blank no longer fails. Eight probes (ldsp-sp-*) and rpg_dsply_subp_test.zig.
Regenerate the operations legend
Some checks reported errors
binjovi/ci A newer source or plan superseded this Build
e1d610d6c4
sean force-pushed ldsp from e1d610d6c4
Some checks reported errors
binjovi/ci A newer source or plan superseded this Build
to 50f18af376
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-14 15:36:26 +00:00
Compare
sean force-pushed ldsp from 50f18af376
All checks were successful
binjovi/ci Binjovi completed the frozen plan
to bfcb6d1b35
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-14 16:30:56 +00:00
Compare
binjovi-bot manually merged commit bfcb6d1b35 into trunk 2026-11-14 16:42:32 +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!802
No description provided.