rpg_date_convert.zig, rpg_eval.zig, rpg_eval_builtins.zig, rpg_source.zig, rpg_facts.zig: date conversions of other formats, of a subfield, and inside a condition #775

Manually merged
binjovi-bot merged 3 commits from ldt2 into trunk 2026-11-10 12:03:12 +00:00
Owner

rpg_date_convert.zig, rpg_eval.zig, rpg_eval_builtins.zig, rpg_source.zig, rpg_facts.zig: date conversions of other formats, of a subfield, and inside a condition

Nine of the ten ldt-dt-cvt captures that left a SOURCERER-FAIL line at v0.1.490 now emit with no failure. Rules:

  • rpg_date_convert.formats: the descriptors of *CMDY (id 52, 9 bytes, /), *CYMD (id 31, 9 bytes, /), *LONGJUL (id 29, 8 bytes, /) and of a timestamp with the separators of *ISO (id 9, 26 bytes, -). Each is the descriptor literal of one measured capture (ldt-char-d-cmdy, -cymd, -longjul, ldt-char-ts, ldt-ts-c). The 0 forms (*CMDY0, ...) are not in the table.

  • rpg_date_convert.recover: the source of the call may be byte K of a structure (33 S; 27 K; 62, then the target as before, or the target with its own type word). The proof's source carries the offset; rpg_eval.dateConvertCall names it S253.10, and rpg_facts.dateConvertText prints it in the call text. Captures: ldt-ds-char-date-usa, ldt-ds-char-time-eur.

  • rpg_eval.callFact and rpg_eval_builtins.dateCompare: a condition showed only the lines of a decimal conversion. The five stores into the three descriptor areas of a date call (descriptorLines) and the call line of a date conversion are counted the same way, so if %CHAR(d: *USA) = c and if %DATE(c: *USA) > d read as conditions. Captures: ldt-cmp-char-usa, ldt-cmp-date-c.

  • rpg_source.zig (callees of rpg_date_fields): _QRNX_DT_CMP is a callee, so the descriptors of a comparison type a static date or time field. In ldt-cmp-date-c the field d was char(10) inz('2026-03-09'), the source has date. The public twins dtcmp-date-gt-d, dtcmp-d-gt-date and dtcmp-date-eq-d declared char(10) inz(...) at v0.1.490 and now declare date inz(d'...'), as their source does; dtcmp-t-lt-time declared char(8) inz('04.05.06') and now declares time inz(t'04.05.06'). The three pinned char(10) lines in src/rpg_file_device_test.zig are updated.

  • Measured at this change (host Debug build, savf rpgle): ldt-char-d-cmdy, -cymd, -longjul, ldt-char-ts, ldt-ts-c, ldt-ds-char-date-usa, ldt-ds-char-time-eur, ldt-cmp-char-usa, ldt-cmp-date-c each report failures 0. The pub400 compile and the object comparison were not run by this lane.

  • ldt-ts-c emits %TIMESTAMP(A_00253: *ISO): its source descriptor holds the separator -. lr3-ts-char (%timestamp(c) with no format) has the separator 0 in both descriptors and keeps %TIMESTAMP(A_00253).

  • Not fixed: ldt-ds-date-c-off (ds.d = %date(ds.c : *usa)). The conversion now reads: the statement text is S253.0 = %DATE(S253.10: *USA) and dateConvertCall s02 no longer fires. The emit still fails with S253.0: 2 types: byte 0 of the structure has the 20-byte store of the start value (37 S253 0, type 13) and the 10-byte store of the date (42, type 11), partTypes records both, and partInfo refuses. The target date is named by no descriptor (the converted value goes into a native temporary), so rpg_date_fields does not type the subfield either. The same shape is lr3x-date-char-in-ds (still unresolved, as at v0.1.490). A rule needs partTypes/narrowPieces in rpg_source.zig to treat the store of the statement at byte 0 as the subfield's type against the structure's start-value store, plus a date field proof from the store of a native temporary; not done here.

  • The tracer tokens rpg_source_stmt.runtimeSummary s19 and s21 fire on none of the 24 ldt-dt-cvt captures, with the v0.1.490 Debug build or this one. A sweep of the other public SC-ILE/EXPERIMENTS probes with this build reaches runtimeSummary s10 (h-now2), s13, s20 (h-now1) and s22, and never s19 or s21. dateConvertCall s02 still fires on lr3x-date-char-in-ds, s7f-types and s7f-types-dflt.

  • Requested, not captured: requests/ldt2/dt-fmt, 13 probes (*CDMY, the 0 forms of *CMDY and *LONGJUL, %CHAR of a date(*usa) field in *EUR and *ISO, %TIMESTAMP(c) without a format, %CHAR(ts: *ISO0), the date target at byte 0 with the source after it, a timestamp subfield, and the conversion in IF, DOW and a field comparison).

  • Tests: src/rpg_ldt2_test.zig (nine probes ldt2-*; none has a pub400 measurement, each asserts no SOURCERER-FAIL and the lines that v0.1.490 did not write)

Gates (ship.sh):

{
  "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": 0,
    "newly_clean": 9,
    "clean_delta": 9,
    "base": 572,
    "new": 581
  },
  "twins": {
    "groups": 820,
    "recovered": 798,
    "regressions": [],
    "newly": 9
  },
  "allgroups": {
    "regressions": [],
    "newly": [],
    "worse": []
  },
  "full_check": {
    "exit": 0,
    "seconds": 1003
  }
}
# rpg_date_convert.zig, rpg_eval.zig, rpg_eval_builtins.zig, rpg_source.zig, rpg_facts.zig: date conversions of other formats, of a subfield, and inside a condition Nine of the ten `ldt-dt-cvt` captures that left a `SOURCERER-FAIL` line at v0.1.490 now emit with no failure. Rules: - `rpg_date_convert.formats`: the descriptors of `*CMDY` (id 52, 9 bytes, `/`), `*CYMD` (id 31, 9 bytes, `/`), `*LONGJUL` (id 29, 8 bytes, `/`) and of a timestamp with the separators of `*ISO` (id 9, 26 bytes, `-`). Each is the descriptor literal of one measured capture (`ldt-char-d-cmdy`, `-cymd`, `-longjul`, `ldt-char-ts`, `ldt-ts-c`). The `0` forms (`*CMDY0`, ...) are not in the table. - `rpg_date_convert.recover`: the source of the call may be byte K of a structure (`33 S; 27 K; 62`, then the target as before, or the target with its own type word). The proof's `source` carries the offset; `rpg_eval.dateConvertCall` names it `S253.10`, and `rpg_facts.dateConvertText` prints it in the call text. Captures: `ldt-ds-char-date-usa`, `ldt-ds-char-time-eur`. - `rpg_eval.callFact` and `rpg_eval_builtins.dateCompare`: a condition showed only the lines of a decimal conversion. The five stores into the three descriptor areas of a date call (`descriptorLines`) and the call line of a date conversion are counted the same way, so `if %CHAR(d: *USA) = c` and `if %DATE(c: *USA) > d` read as conditions. Captures: `ldt-cmp-char-usa`, `ldt-cmp-date-c`. - `rpg_source.zig` (callees of `rpg_date_fields`): `_QRNX_DT_CMP` is a callee, so the descriptors of a comparison type a static date or time field. In `ldt-cmp-date-c` the field `d` was `char(10) inz('2026-03-09')`, the source has `date`. The public twins `dtcmp-date-gt-d`, `dtcmp-d-gt-date` and `dtcmp-date-eq-d` declared `char(10) inz(...)` at v0.1.490 and now declare `date inz(d'...')`, as their source does; `dtcmp-t-lt-time` declared `char(8) inz('04.05.06')` and now declares `time inz(t'04.05.06')`. The three pinned `char(10)` lines in `src/rpg_file_device_test.zig` are updated. - Measured at this change (host Debug build, `savf rpgle`): `ldt-char-d-cmdy`, `-cymd`, `-longjul`, `ldt-char-ts`, `ldt-ts-c`, `ldt-ds-char-date-usa`, `ldt-ds-char-time-eur`, `ldt-cmp-char-usa`, `ldt-cmp-date-c` each report `failures 0`. The pub400 compile and the object comparison were not run by this lane. - `ldt-ts-c` emits `%TIMESTAMP(A_00253: *ISO)`: its source descriptor holds the separator `-`. `lr3-ts-char` (`%timestamp(c)` with no format) has the separator 0 in both descriptors and keeps `%TIMESTAMP(A_00253)`. - Not fixed: `ldt-ds-date-c-off` (`ds.d = %date(ds.c : *usa)`). The conversion now reads: the statement text is `S253.0 = %DATE(S253.10: *USA)` and `dateConvertCall s02` no longer fires. The emit still fails with `S253.0: 2 types`: byte 0 of the structure has the 20-byte store of the start value (`37 S253 0`, type 13) and the 10-byte store of the date (`42`, type 11), `partTypes` records both, and `partInfo` refuses. The target date is named by no descriptor (the converted value goes into a native temporary), so `rpg_date_fields` does not type the subfield either. The same shape is `lr3x-date-char-in-ds` (still unresolved, as at v0.1.490). A rule needs `partTypes`/`narrowPieces` in `rpg_source.zig` to treat the store of the statement at byte 0 as the subfield's type against the structure's start-value store, plus a date field proof from the store of a native temporary; not done here. - The tracer tokens `rpg_source_stmt.runtimeSummary s19` and `s21` fire on none of the 24 `ldt-dt-cvt` captures, with the v0.1.490 Debug build or this one. A sweep of the other public `SC-ILE/EXPERIMENTS` probes with this build reaches `runtimeSummary` s10 (`h-now2`), s13, s20 (`h-now1`) and s22, and never s19 or s21. `dateConvertCall s02` still fires on `lr3x-date-char-in-ds`, `s7f-types` and `s7f-types-dflt`. - Requested, not captured: `requests/ldt2/dt-fmt`, 13 probes (`*CDMY`, the `0` forms of `*CMDY` and `*LONGJUL`, `%CHAR` of a `date(*usa)` field in `*EUR` and `*ISO`, `%TIMESTAMP(c)` without a format, `%CHAR(ts: *ISO0)`, the date target at byte 0 with the source after it, a timestamp subfield, and the conversion in `IF`, `DOW` and a field comparison). - Tests: `src/rpg_ldt2_test.zig` (nine probes `ldt2-*`; none has a pub400 measurement, each asserts no `SOURCERER-FAIL` and the lines that v0.1.490 did not write) Gates (ship.sh): ```json { "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": 0, "newly_clean": 9, "clean_delta": 9, "base": 572, "new": 581 }, "twins": { "groups": 820, "recovered": 798, "regressions": [], "newly": 9 }, "allgroups": { "regressions": [], "newly": [], "worse": [] }, "full_check": { "exit": 0, "seconds": 1003 } } ```
sean force-pushed ldt2 from 8694077b24
Some checks reported errors
binjovi/ci A newer source or plan superseded this Build
to 022cc3be36
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-10 11:49:14 +00:00
Compare
binjovi-bot manually merged commit 022cc3be36 into trunk 2026-11-10 12:03: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!775
No description provided.