Skip to content

gogen: READ and DELETE TABLE by a hashed secondary key (abapiti 042) - #698

Merged
oisee merged 1 commit into
mainfrom
fix/osgo-hashed-secondary-key
Oct 9, 2026
Merged

oisee merged 1 commit into
mainfrom
fix/osgo-hashed-secondary-key

Conversation

@oisee

@oisee oisee commented Oct 9, 2026

Copy link
Copy Markdown
Owner

abapiti inbox 042. abapiti keeps a map as a standard table in insertion order with a unique hashed secondary key; osgo refused it as NOT_COMPILED ("key BY_K: a hashed secondary key"), OSG-JS ran it.

Now lowered in both emitters

  • READ TABLE ... WITH KEY k COMPONENTS ... over a hashed secondary key (INTO a work area of the row's type, ASSIGNING, REFERENCE INTO, TRANSPORTING NO FIELDS): sy-subrc 0/4, target untouched on a miss, sy-tabix 0.
  • DELETE TABLE ... WITH TABLE KEY k COMPONENTS ... over a unique secondary key (hashed or sorted), every component once: sy-subrc 0/4, sy-tabix untouched.

Still refused (ZCL_GOGEN_T_RF_SECKEYH): LOOP ... USING a hashed key (order not measured), READ ... INTO a work area of another type (no row conversion), the DELETE inside a LOOP over the same table.

Not faster. abap.KeyFind / keyFind scan, as the sorted-key reads already do: the table is a plain slice whose rows can change in place. Correct, not O(1); a real index is separate work.

Evidence

  • red before: ZCL_GOGEN_T_SECKEYH NOT_COMPILED in Go and JS; after: r:0 i:0/3 miss:4/99 t:0 d:0 i:1/0 d2:4 a10c3 in both.
  • node tools/gogen/semantics.mjs: 387 ok, 0 FAIL; emit-go.test.mjs 14/14; size budget exit 0 (six budgets raised with the reason); leak scan clean.
  • Unmeasured on A4H past abapiti's own run of the first READ and DELETE (a10). ABAP documentation: sy-tabix 0 for a hit by a hashed key, a miss undefined (0 is set).
  • codex critic, one round: FIX (row conversion on INTO, temporaries v<n>/i shadowable by ABAP names in both emitters, sy-tabix wording). All fixed: INTO conversion refused, temporaries spelled kV/kI/kR, fixture has a local v0 and a table named i.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VUy1x5QYimNEytFZpg7t7S

abapiti keeps a map as a standard table in insertion order with a unique
hashed secondary key for lookups. osgo refused the key as NOT_COMPILED
("key BY_K: a hashed secondary key"), while OSG-JS ran it.

Now both emitters lower:
- READ TABLE ... WITH KEY k COMPONENTS ... over a hashed secondary key
  (INTO a work area of the row's type, ASSIGNING, REFERENCE INTO,
  TRANSPORTING NO FIELDS): the row holding the values, sy-subrc 0 or 4,
  the target left alone on a miss, sy-tabix 0;
- DELETE TABLE ... WITH TABLE KEY k COMPONENTS ... over a unique secondary
  key (hashed or sorted), every component given once: the row goes,
  sy-subrc 0 or 4. Refused inside a LOOP over the same table, as
  DELETE TABLE ... FROM is.

The lookup scans (abap.KeyFind / keyFind), as the sorted-key reads already
do: the table is a plain slice whose rows can change in place, so this is
correct, not O(1). Stays refused: LOOP ... USING a hashed key (its order
is not measured) and READ ... INTO a work area of another type (the row
is not converted). The emitters' temporaries are spelled kV/kI/kR, which
no ABAP name lowers to, so a local v0 or a table named i cannot shadow
them (critic round).

ZCL_GOGEN_T_SECKEYH pins it in both emitters, ZCL_GOGEN_T_RF_SECKEYH the
refusals. Unmeasured past abapiti's own A4H run of the first READ and
DELETE (a10): the ABAP documentation gives sy-tabix 0 for a hit by a
hashed key and leaves a miss undefined, where 0 is set too. Red before:
NOT_COMPILED in Go and JS.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VUy1x5QYimNEytFZpg7t7S
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Preview: open the launchpad - the OData gateway, the demo and Zork run in your browser, no server.

Screenshots - built from fd0ba67

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR tests: 🟢 pass

Commit: 951046ab · Full test log

Job Result Time
build 🟢 pass 310 s
adt-lifecycle 🟢 pass 1634 s
e2e 🟢 pass 175 s
kernel-conformance 🟢 pass 239 s
packaging 🟢 pass 356 s
suites (4) 🟢 pass 878 s
osgo-host 🟢 pass 242 s
suites (1) 🟢 pass 1169 s
suites (6) 🟢 pass 685 s
suites (2) 🟢 pass 782 s
suites (3) 🟢 pass 997 s
suites (5) 🟢 pass 1080 s

ADT lifecycle: PASS

Commit: fd0ba67 · SDK 8.4.3 · VSP baac6f4c97fb3ea1dee9b7772e24d52855af2985

124 PASS, 4 N/A, 3 MISSING

Functional operations, active readback, cleanup and warm-swap checks determine the required gate.

Timing advisory: QUIET

Client wall time in ms. VSP update includes Check and Activate. Cold REPORT/DDLS are measured too. Parallel CI job; operations within each server are sequential.

Reference: median of ABAP-FS/CLAS/edit, ABAP-FS/CLAS/readback-active, ABAP-FS/INTF/edit, ABAP-FS/INTF/readback-active; current 54 ms.

History: 5/5 compatible green main runs (newest first; fewer when unavailable). Each run is normalized by its own reference before taking the main median.

Warn when at least 2 operations exceed 1.3x, or any operation reaches 2x. Timing never fails the CI gate.

Client/type/operation Median ms Samples ms main ms (raw median) Current/reference main normalized median Ratio Main runs Timing
ABAP-FS/CLAS/edit 139 139, 216, 82 154 2.574 2.839 0.907x 5 quiet
ABAP-FS/CLAS/check 1856 1528, 1958, 1856 2008 34.370 40.980 0.839x 5 quiet
ABAP-FS/CLAS/activate-edit 3184 2654, 3351, 3184 3248 58.963 67.208 0.877x 5 quiet
ABAP-FS/CLAS/readback-active 31 93, 31, 23 27 0.574 0.505 1.138x 5 quiet
ABAP-FS/INTF/edit 77 76, 77, 181 76 1.426 1.495 0.953x 5 quiet
ABAP-FS/INTF/check 1927 2142, 1927, 1832 2049 35.685 40.102 0.890x 5 quiet
ABAP-FS/INTF/activate-edit 3193 3193, 3293, 2945 3419 59.130 70.179 0.843x 5 quiet
ABAP-FS/INTF/readback-active 24 24, 16, 25 21 0.444 0.429 1.037x 5 quiet
ABAP-FS/PROG/edit 102 75, 129, 102 103 1.889 1.929 0.979x 5 quiet
ABAP-FS/PROG/check 5368 5652, 5368, 4639 4692 99.407 96.208 1.033x 5 quiet
ABAP-FS/PROG/activate-edit 52314 52314, 54621, 47629 52038 968.778 986.125 0.982x 5 quiet
ABAP-FS/PROG/readback-active 75 75, 79, 75 81 1.389 1.583 0.877x 5 quiet
ABAP-FS/INCL/edit 104 104, 278, 87 88 1.926 1.816 1.060x 5 quiet
ABAP-FS/INCL/check 1863 2086, 1863, 1779 2096 34.500 42.776 0.807x 5 quiet
ABAP-FS/INCL/activate-edit 3014 2659, 3014, 3067 3402 55.815 68.449 0.815x 5 quiet
ABAP-FS/INCL/readback-active 28 99, 21, 28 24 0.519 0.500 1.037x 5 quiet
ABAP-FS/DDLS/edit 103 89, 126, 103 105 1.907 1.946 0.980x 5 quiet
ABAP-FS/DDLS/check 9467 10665, 9467, 8494 8475 175.315 153.786 1.140x 5 quiet
ABAP-FS/DDLS/activate-edit 55485 55485, 56825, 52853 56242 1027.500 1020.793 1.007x 5 quiet
ABAP-FS/DDLS/readback-active 83 849, 83, 82 82 1.537 1.708 0.900x 5 quiet
VSP/CLAS/edit+check+activate 4585 4442, 5014, 4585 5775 84.907 107.333 0.791x 5 quiet
VSP/INTF/edit+check+activate 5293 6066, 5293, 4996 5759 98.019 114.633 0.855x 5 quiet
VSP/PROG/edit+check+activate 49022 48997, 49022, 49653 50283 907.815 975.625 0.930x 5 quiet
VSP/INCL/edit+check+activate 5194 4440, 5414, 5194 5138 96.185 110.342 0.872x 5 quiet
VSP/DDLS/edit+check+activate 63065 64250, 63065, 62562 60331 1167.870 1179.896 0.990x 5 quiet
Client Type Operation Result ms Note
ABAP-FS DEVC validate PASS 29
ABAP-FS DEVC create PASS 117
ABAP-FS DEVC edit N/A Package metadata update has no SDK/VSP source operation
ABAP-FS DEVC activate N/A Package is created active; no source activation
ABAP-FS CLAS validate PASS 19
ABAP-FS CLAS create PASS 69
ABAP-FS CLAS write-initial PASS 98
ABAP-FS INTF validate PASS 16
ABAP-FS INTF create PASS 39
ABAP-FS INTF write-initial PASS 66
ABAP-FS PROG validate MISSING 10 /sap/bc/adt/programs/validation is not served by OSD
ABAP-FS PROG create PASS 50
ABAP-FS PROG write-initial PASS 75
ABAP-FS INCL validate MISSING 11 /sap/bc/adt/includes/validation is not served by OSD
ABAP-FS INCL create PASS 8448
ABAP-FS INCL write-initial PASS 425
ABAP-FS DDLS validate MISSING 11 /sap/bc/adt/ddic/ddl/validation is not served by OSD
ABAP-FS DDLS create PASS 41
ABAP-FS DDLS write-initial PASS 71
ABAP-FS ALL5 activate-initial PASS 45878
ABAP-FS CLAS edit #1 PASS 139
ABAP-FS CLAS check #1 PASS 1528
ABAP-FS CLAS activate-edit #1 PASS 2654
ABAP-FS CLAS readback-active #1 PASS 93
ABAP-FS CLAS edit #2 PASS 216
ABAP-FS CLAS check #2 PASS 1958
ABAP-FS CLAS activate-edit #2 PASS 3351
ABAP-FS CLAS readback-active #2 PASS 31
ABAP-FS CLAS edit #3 PASS 82
ABAP-FS CLAS check #3 PASS 1856
ABAP-FS CLAS activate-edit #3 PASS 3184
ABAP-FS CLAS readback-active #3 PASS 23
ABAP-FS INTF edit #1 PASS 76
ABAP-FS INTF check #1 PASS 2142
ABAP-FS INTF activate-edit #1 PASS 3193
ABAP-FS INTF readback-active #1 PASS 24
ABAP-FS INTF edit #2 PASS 77
ABAP-FS INTF check #2 PASS 1927
ABAP-FS INTF activate-edit #2 PASS 3293
ABAP-FS INTF readback-active #2 PASS 16
ABAP-FS INTF prepare-baseline PASS 26470
ABAP-FS INTF edit #3 PASS 181
ABAP-FS INTF check #3 PASS 1832
ABAP-FS INTF activate-edit #3 PASS 2945
ABAP-FS INTF readback-active #3 PASS 25
ABAP-FS PROG edit #1 PASS 75
ABAP-FS PROG check #1 PASS 5652
ABAP-FS PROG activate-edit #1 PASS 52314
ABAP-FS PROG readback-active #1 PASS 75
ABAP-FS PROG edit #2 PASS 129
ABAP-FS PROG check #2 PASS 5368
ABAP-FS PROG activate-edit #2 PASS 54621
ABAP-FS PROG readback-active #2 PASS 79
ABAP-FS PROG edit #3 PASS 102
ABAP-FS PROG check #3 PASS 4639
ABAP-FS PROG activate-edit #3 PASS 47629
ABAP-FS PROG readback-active #3 PASS 75
ABAP-FS INCL edit #1 PASS 104
ABAP-FS INCL check #1 PASS 2086
ABAP-FS INCL activate-edit #1 PASS 2659
ABAP-FS INCL readback-active #1 PASS 99
ABAP-FS INCL edit #2 PASS 278
ABAP-FS INCL check #2 PASS 1863
ABAP-FS INCL activate-edit #2 PASS 3014
ABAP-FS INCL readback-active #2 PASS 21
ABAP-FS INCL edit #3 PASS 87
ABAP-FS INCL check #3 PASS 1779
ABAP-FS INCL activate-edit #3 PASS 3067
ABAP-FS INCL readback-active #3 PASS 28
ABAP-FS DDLS edit #1 PASS 89
ABAP-FS DDLS check #1 PASS 10665
ABAP-FS DDLS activate-edit #1 PASS 55485
ABAP-FS DDLS readback-active #1 PASS 849
ABAP-FS DDLS edit #2 PASS 126
ABAP-FS DDLS check #2 PASS 9467
ABAP-FS DDLS activate-edit #2 PASS 56825
ABAP-FS DDLS readback-active #2 PASS 83
ABAP-FS DDLS edit #3 PASS 103
ABAP-FS DDLS check #3 PASS 8494
ABAP-FS DDLS activate-edit #3 PASS 52853
ABAP-FS DDLS readback-active #3 PASS 82
VSP DEVC create PASS 118
VSP DEVC edit N/A VSP has CreatePackage; no package metadata update tool
VSP DEVC activate N/A Created active
VSP CLAS create+write+activate PASS 43180
VSP CLAS edit+check+activate #1 PASS 4442
VSP CLAS edit+check+activate #2 PASS 5014
VSP CLAS edit+check+activate #3 PASS 4585
VSP CLAS check-explicit PASS 2172
VSP CLAS activate-explicit PASS 2277
VSP CLAS readback-vsp PASS 25
VSP INTF create+write+activate PASS 60839
VSP INTF edit+check+activate #1 PASS 6066
VSP INTF edit+check+activate #2 PASS 5293
VSP INTF edit+check+activate #3 PASS 4996
VSP INTF check-explicit PASS 1758
VSP INTF activate-explicit PASS 2237
VSP INTF readback-vsp PASS 25
VSP PROG create+write+activate PASS 55931
VSP PROG edit+check+activate #1 PASS 48997
VSP PROG edit+check+activate #2 PASS 49022
VSP PROG edit+check+activate #3 PASS 49653
VSP PROG check-explicit PASS 2133
VSP PROG activate-explicit PASS 24204
VSP PROG readback-vsp PASS 81
VSP INCL create+write+activate PASS 52196
VSP INCL edit+check+activate #1 PASS 4440
VSP INCL edit+check+activate #2 PASS 5414
VSP INCL edit+check+activate #3 PASS 5194
VSP INCL check-explicit PASS 2017
VSP INCL activate-explicit PASS 2355
VSP INCL readback-vsp PASS 17
VSP DDLS create+write+activate PASS 57595
VSP DDLS edit+check+activate #1 PASS 64250
VSP DDLS edit+check+activate #2 PASS 63065
VSP DDLS edit+check+activate #3 PASS 62562
VSP DDLS check-explicit PASS 6175
VSP DDLS activate-explicit PASS 24702
VSP DDLS readback-vsp PASS 22
VSP DDLS delete+confirmed-404 PASS 84
VSP INCL delete+confirmed-404 PASS 2728
VSP PROG delete+confirmed-404 PASS 147
VSP INTF delete+confirmed-404 PASS 140
VSP CLAS delete+confirmed-404 PASS 55
VSP DEVC delete+confirmed-404 PASS 59
ABAP-FS DDLS delete+confirmed-404 PASS 58
ABAP-FS INCL delete+confirmed-404 PASS 2532
ABAP-FS PROG delete+confirmed-404 PASS 156
ABAP-FS INTF delete+confirmed-404 PASS 134
ABAP-FS CLAS delete+confirmed-404 PASS 81
ABAP-FS DEVC delete+confirmed-404 PASS 48

Required merge checks: test + scan. ADT lifecycle timing, Docker, gogen, preview, size and queue are advisory on PRs; lifecycle functional checks remain required (Alice, 2026-10-07).

@oisee
oisee merged commit d858ca0 into main Oct 9, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant