The emitter writes thread(*concurrent) and declares thread-local static fields (touches rpg_source.zig) #782

Manually merged
binjovi-bot merged 2 commits from lext4 into trunk 2026-11-11 00:25:12 +00:00
Owner

Lane Lext, round four. The statements of a THREAD(*CONCURRENT) module recover since
rounds one to three; its text still refused two things: the module keyword
(SOURCERER-FAIL THREAD(*CONCURRENT)), and every static field (no declaration of symbol N: flag word 0x7000c100: not a declaration), so no concurrent twin could rebuild its object.

The rule

rpg_source_decl.concurrent proves a concurrent module: the compiler's own frame areas (the
kind 8 static symbols with the flag word 0xf800c000, six in every public module with a
procedure) all carry the thread-local bit 0x100 and none lacks it. The bit is on every static
data symbol of the 25 public concurrent captures and of the six L10 development programs,
except static(*allthread) fields and the compiler's symbols for a local one, and on no static
symbol of the 781 public twins or of lext-serialize-c. The bit on a field alone, or on some
frame areas only, proves nothing: that module keeps a failure line (threadLocalStorage,
text changed to "not proved to be a concurrent module").

  • ctlOpt writes thread(*concurrent) for a proved module.
  • rpg_source_decl.declaredIn reads a static symbol of a proved module by its flag word without
    the bit (sourceField), so the declaration emitter and rpg_source_unused.statics declare a
    thread-local field exactly as the plain twin does (lext-call-void-c has the dcl-s lines of
    lext-call-void-p). A module that is not proved keeps declared.
  • rpg_source.userStart compares the flag word without the bit. With the raw word it was 0 in a
    concurrent module (the first fixed symbol, 0x08008100, was not found), so no fixed symbol of the
    compiler was refused as a field, and no unused field was found (sourceEnd needs the start).
  • rpg_source.zig is touched in these places only: ctlOpt (the keyword and the two failure
    lines), userStart (above), Decl.allthread and Decl.storage with their four uses in the
    dcl-s, dcl-ds, template and likerec lines (they replace if (d.static) " static" else ""),
    the pointer test of a based structure (decl_mod.declaredIn for declared), and the removed
    alias declared. rpg_source_decl_emit.zig: the field test in declare, the allthread flag,
    and fitGlobals (an allthread field is not moved into a subprocedure).
  • static(*allthread): in a proved module a field of the source (allthread: class 3, no bit, the
    flag word of a field, inside the range of the source symbols userStart to sourceEnd) is written
    with static(*allthread) (Decl.allthread), and it is never moved into a subprocedure by
    fitGlobals. Proof of the keyword: lext-static-all-c (shared has no bit, local has it),
    lext-allthread-local-c and -noinz-c, and the eight global static(*allthread) declarations of
    each L10 development program are the eight symbols without the bit; no field of the source has the
    bit off otherwise.
  • The start value of such a field is NOT proved. The static initialization stores the thread-local
    fields (the plain twin lext-static-all-p stores inz(0) into both fields; lext-static-all-c
    stores only into the thread-local one), and the allthread field has no store at all: asyncbg has
    gNextSlot int(10) inz(1) static(*allthread) and no operation stores 1 into it. The text is written
    without a start value, and the trailer failure line "the start value of a static(*allthread)
    field is in no operation of the module and is not written" stays in every module that has such a
    field.
  • A procedure-local static(*allthread) field also has compiler symbols without the bit that are no
    field (a flag and a 32-byte area, flag words 0x7800c000 and 0x6000c000; lext-allthread-local-c,
    -noinz-c, and asyncage, the one L10 program with such a field). Which field is the local one is not
    proved, so localAllthread keeps a trailer failure line: THREAD(*CONCURRENT): a static symbol without the thread-local bit that is no field of the source (a procedure-local static(*allthread) field) has no emit rule; it stands for the start-value line as well (one line).
    The fields are still written, at module level with the keyword, and the statements that name them
    are emitted.
  • A thread-local static inside a procedure (lext-local-static-c) has the bit like every other
    field and is declared as in a plain module.
  • thread(*serialize) is unchanged (serialized); a plain module gets no thread keyword.

Evidence

src/rpg_lext4_test.zig (red before: the emit of lext-call-void-c had the failure line and no
keyword, and the dcl-s lines differed from lext-call-void-p): the keyword and the plain
declarations of the concurrent twins, no failure line but the partial compiler statement in the six
lext-call-*-c twins, no thread keyword in the plain twins, thread(*serialize) kept, one
static(*allthread) and one plain field in lext-static-all-c, the local static plain, the
local static(*allthread) failure line, and the predicates on mutated symbols (the bit cleared on the
frame areas, on one frame area). Two probes are adopted as twins: lext-static-all-c,
lext-local-static-c.

Counter, public (the 25 concurrent captures of lext-thread-call, lext-psds-call,
lext-allthread-local, lext-allthread-local-r2; emits with no failure line other than
compiler statement ... is partial): 0 of 25 before, 8 of 25 after (lext-call-void-c, -const-c,
-value-c, -ref-c, -nested-c, -ret-c, lext-ptr-cmp-c, lext-local-static-c).
lext-static-all-c has 1 failure (the start value, above) and emits all 4 statements. Counter, L10
development data (six programs, Debug build, sourcerer --json savf rpgle),
[statements, emitted, failures]:

program before after
asyncage 584, 216, 376 584, 226, 366
asyncdemo 621, 231, 398 621, 241, 388
asyncbg 597, 222, 383 597, 232, 373
asynccncl 608, 223, 394 608, 233, 384
asyncprom 619, 226, 401 619, 236, 391
asynctime 630, 239, 399 630, 249, 389

Read against the base emit of asyncbg: the ten new statements are the ones that named a thread-local
field without a declaration (STARTTHREAD_00515 = 0;, if STARTTHREAD_00514;, else;, endif;), and the
declarations of seven fields now carry static(*allthread). Every c twin that has a plain sibling
(void, ret, import, export-main, ptr-cmp, psds-void, static-all) has the emit of the sibling
modulo the ctl-opt keyword, the allthread keyword and the failure lines.

Gate (emit of all 833 stripped public programs, base against this build): 0 worse, 12 better, failures
613 to 590, emitted 7,920 to 7,932, only the 14 emits of concurrent twins differ in bytes (every plain
twin byte for byte equal); twins: 826 groups, 804 recovered, 0 regressions, 0 newly recovered; the twins that were committed on trunk with a THREAD failure lose that
line (their failure count falls); lext-allthread-local-c and -noinz-c keep 3 failures (the line is
replaced by the local static(*allthread) line).

What keeps a failure line, and what is not proved

  • A module with a procedure-local static(*allthread) field (the trailer line above).
  • A module with the bit on a field and not on all frame areas (the line "not proved").
  • static(*allthread) text of a data structure, an array, a pointer, a packed field is written by
    the same rule, but no public capture compiled it (only int(10) in lext-static-all-c; the L10
    sources have them and the text follows them). The coordinator's round trip of lext-static-all-c
    and lext-local-static-c decides; the battery requests/lext/allthread-decl (11 cases) asks the
    rest, and whether inz(5) on an allthread field leaves any trace in the module.
  • Readers of the raw flag word outside the files of this lane, not measured on a concurrent module with
    a packed, zoned, structure or file field: the 0x08008000 marker in rpg_source_scale.zig (two
    sites) and rpg_source_iospec.zig, udateKey in rpg_source.zig, and the 0x70000000 tests in
    rpg_source_byref.zig. A concurrent module with such a field may still fail there.
  • The program status data structure (SOURCERER-FAIL PSDS stays), if/endif read as select,
    calls of imported procedures, callp(e) and monitor: not this round.

Release gate (coordinator, build of 94b9cae1 against v0.1.498)

  • Ship row 94b9cae1: all gates passed (census 645/0, twins regressions none, emit worse none).
  • Development emits: byte-identical. L10-test direction: unchanged.
  • Committed twins (emit-bytes-diff.sh): only thread(*concurrent) twins change.
  • 40 lane and L10 development captures (capture-emit-diff.sh): 31 change, none with fewer emitted statements or more failures; thread(*concurrent) in the ctl-opt agrees with the source in all 40.
  • Host round trips, v0.1.498 then this build: lext-call-void-c, -const-c, -value-c, -ref-c, -nested-c, -ret-c different, now match; lext-ptr-cmp-c and lext-local-static-c different in both (fewer differing components); lext-static-all-c refused in both (unsupported_layout, the comparison); lext-serialize-c match in both.
Lane Lext, round four. The statements of a THREAD(*CONCURRENT) module recover since rounds one to three; its text still refused two things: the module keyword (`SOURCERER-FAIL THREAD(*CONCURRENT)`), and every static field (`no declaration of symbol N: flag word 0x7000c100: not a declaration`), so no concurrent twin could rebuild its object. ## The rule `rpg_source_decl.concurrent` proves a concurrent module: the compiler's own frame areas (the kind 8 static symbols with the flag word `0xf800c000`, six in every public module with a procedure) all carry the thread-local bit 0x100 and none lacks it. The bit is on every static data symbol of the 25 public concurrent captures and of the six L10 development programs, except `static(*allthread)` fields and the compiler's symbols for a local one, and on no static symbol of the 781 public twins or of `lext-serialize-c`. The bit on a field alone, or on some frame areas only, proves nothing: that module keeps a failure line (`threadLocalStorage`, text changed to "not proved to be a concurrent module"). - `ctlOpt` writes `thread(*concurrent)` for a proved module. - `rpg_source_decl.declaredIn` reads a static symbol of a proved module by its flag word without the bit (`sourceField`), so the declaration emitter and `rpg_source_unused.statics` declare a thread-local field exactly as the plain twin does (`lext-call-void-c` has the `dcl-s` lines of `lext-call-void-p`). A module that is not proved keeps `declared`. - `rpg_source.userStart` compares the flag word without the bit. With the raw word it was 0 in a concurrent module (the first fixed symbol, `0x08008100`, was not found), so no fixed symbol of the compiler was refused as a field, and no unused field was found (`sourceEnd` needs the start). - `rpg_source.zig` is touched in these places only: `ctlOpt` (the keyword and the two failure lines), `userStart` (above), `Decl.allthread` and `Decl.storage` with their four uses in the `dcl-s`, `dcl-ds`, template and likerec lines (they replace `if (d.static) " static" else ""`), the pointer test of a based structure (`decl_mod.declaredIn` for `declared`), and the removed alias `declared`. `rpg_source_decl_emit.zig`: the field test in `declare`, the `allthread` flag, and `fitGlobals` (an allthread field is not moved into a subprocedure). - `static(*allthread)`: in a proved module a field of the source (`allthread`: class 3, no bit, the flag word of a field, inside the range of the source symbols `userStart` to `sourceEnd`) is written with `static(*allthread)` (`Decl.allthread`), and it is never moved into a subprocedure by `fitGlobals`. Proof of the keyword: `lext-static-all-c` (`shared` has no bit, `local` has it), `lext-allthread-local-c` and `-noinz-c`, and the eight global `static(*allthread)` declarations of each L10 development program are the eight symbols without the bit; no field of the source has the bit off otherwise. - The start value of such a field is NOT proved. The static initialization stores the thread-local fields (the plain twin `lext-static-all-p` stores `inz(0)` into both fields; `lext-static-all-c` stores only into the thread-local one), and the allthread field has no store at all: asyncbg has `gNextSlot int(10) inz(1) static(*allthread)` and no operation stores 1 into it. The text is written without a start value, and the trailer failure line "the start value of a static(*allthread) field is in no operation of the module and is not written" stays in every module that has such a field. - A procedure-local `static(*allthread)` field also has compiler symbols without the bit that are no field (a flag and a 32-byte area, flag words `0x7800c000` and `0x6000c000`; `lext-allthread-local-c`, `-noinz-c`, and asyncage, the one L10 program with such a field). Which field is the local one is not proved, so `localAllthread` keeps a trailer failure line: `THREAD(*CONCURRENT): a static symbol without the thread-local bit that is no field of the source (a procedure-local static(*allthread) field) has no emit rule`; it stands for the start-value line as well (one line). The fields are still written, at module level with the keyword, and the statements that name them are emitted. - A thread-local `static` inside a procedure (`lext-local-static-c`) has the bit like every other field and is declared as in a plain module. - `thread(*serialize)` is unchanged (`serialized`); a plain module gets no thread keyword. ## Evidence `src/rpg_lext4_test.zig` (red before: the emit of `lext-call-void-c` had the failure line and no keyword, and the `dcl-s` lines differed from `lext-call-void-p`): the keyword and the plain declarations of the concurrent twins, no failure line but the partial compiler statement in the six `lext-call-*-c` twins, no thread keyword in the plain twins, `thread(*serialize)` kept, one `static(*allthread)` and one plain field in `lext-static-all-c`, the local `static` plain, the local `static(*allthread)` failure line, and the predicates on mutated symbols (the bit cleared on the frame areas, on one frame area). Two probes are adopted as twins: `lext-static-all-c`, `lext-local-static-c`. Counter, public (the 25 concurrent captures of `lext-thread-call`, `lext-psds-call`, `lext-allthread-local`, `lext-allthread-local-r2`; emits with no failure line other than `compiler statement ... is partial`): 0 of 25 before, 8 of 25 after (`lext-call-void-c`, `-const-c`, `-value-c`, `-ref-c`, `-nested-c`, `-ret-c`, `lext-ptr-cmp-c`, `lext-local-static-c`). `lext-static-all-c` has 1 failure (the start value, above) and emits all 4 statements. Counter, L10 development data (six programs, Debug build, `sourcerer --json savf rpgle`), `[statements, emitted, failures]`: | program | before | after | |---|---|---| | asyncage | 584, 216, 376 | 584, 226, 366 | | asyncdemo | 621, 231, 398 | 621, 241, 388 | | asyncbg | 597, 222, 383 | 597, 232, 373 | | asynccncl | 608, 223, 394 | 608, 233, 384 | | asyncprom | 619, 226, 401 | 619, 236, 391 | | asynctime | 630, 239, 399 | 630, 249, 389 | Read against the base emit of asyncbg: the ten new statements are the ones that named a thread-local field without a declaration (`STARTTHREAD_00515 = 0;`, `if STARTTHREAD_00514;`, `else;`, `endif;`), and the declarations of seven fields now carry `static(*allthread)`. Every `c` twin that has a plain sibling (`void`, `ret`, `import`, `export-main`, `ptr-cmp`, `psds-void`, `static-all`) has the emit of the sibling modulo the `ctl-opt` keyword, the allthread keyword and the failure lines. Gate (emit of all 833 stripped public programs, base against this build): 0 worse, 12 better, failures 613 to 590, emitted 7,920 to 7,932, only the 14 emits of concurrent twins differ in bytes (every plain twin byte for byte equal); twins: 826 groups, 804 recovered, 0 regressions, 0 newly recovered; the twins that were committed on trunk with a `THREAD` failure lose that line (their failure count falls); `lext-allthread-local-c` and `-noinz-c` keep 3 failures (the line is replaced by the local `static(*allthread)` line). ## What keeps a failure line, and what is not proved - A module with a procedure-local `static(*allthread)` field (the trailer line above). - A module with the bit on a field and not on all frame areas (the line "not proved"). - `static(*allthread)` text of a data structure, an array, a pointer, a packed field is written by the same rule, but no public capture compiled it (only int(10) in `lext-static-all-c`; the L10 sources have them and the text follows them). The coordinator's round trip of `lext-static-all-c` and `lext-local-static-c` decides; the battery `requests/lext/allthread-decl` (11 cases) asks the rest, and whether `inz(5)` on an allthread field leaves any trace in the module. - Readers of the raw flag word outside the files of this lane, not measured on a concurrent module with a packed, zoned, structure or file field: the `0x08008000` marker in `rpg_source_scale.zig` (two sites) and `rpg_source_iospec.zig`, `udateKey` in `rpg_source.zig`, and the `0x70000000` tests in `rpg_source_byref.zig`. A concurrent module with such a field may still fail there. - The program status data structure (`SOURCERER-FAIL PSDS` stays), `if`/`endif` read as `select`, calls of imported procedures, `callp(e)` and `monitor`: not this round. ## Release gate (coordinator, build of 94b9cae1 against v0.1.498) - Ship row 94b9cae1: all gates passed (census 645/0, twins regressions none, emit worse none). - Development emits: byte-identical. L10-test direction: unchanged. - Committed twins (`emit-bytes-diff.sh`): only `thread(*concurrent)` twins change. - 40 lane and L10 development captures (`capture-emit-diff.sh`): 31 change, none with fewer emitted statements or more failures; `thread(*concurrent)` in the `ctl-opt` agrees with the source in all 40. - Host round trips, v0.1.498 then this build: `lext-call-void-c`, `-const-c`, `-value-c`, `-ref-c`, `-nested-c`, `-ret-c` different, now `match`; `lext-ptr-cmp-c` and `lext-local-static-c` different in both (fewer differing components); `lext-static-all-c` refused in both (`unsupported_layout`, the comparison); `lext-serialize-c` `match` in both.
A module whose compiler frame areas all carry the thread-local bit is a
concurrent module: the ctl-opt gets thread(*concurrent), a static field is
declared as in a plain module, and a field without the bit is written with
static(*allthread). The start value of an allthread field is in no operation
and stays a failure line, as does a procedure-local allthread field. The emit
start of the fixed symbols reads the flag word without the bit.
sean force-pushed lext4 from 94b9cae1a6 to 1ee33ceaa0
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-11 00:15:09 +00:00
Compare
binjovi-bot manually merged commit 1ee33ceaa0 into trunk 2026-11-11 00:25:12 +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!782
No description provided.