Repository navigation
gogen: READ and DELETE TABLE by a hashed secondary key (abapiti 042) - #698
Conversation
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
|
Preview: open the launchpad - the OData gateway, the demo and Zork run in your browser, no server. Screenshots - built from |
PR tests: 🟢 passCommit:
ADT lifecycle: PASSCommit: 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: QUIETClient 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.
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). |
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/keyFindscan, 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
ZCL_GOGEN_T_SECKEYHNOT_COMPILED in Go and JS; after:r:0 i:0/3 miss:4/99 t:0 d:0 i:1/0 d2:4 a10c3in both.node tools/gogen/semantics.mjs: 387 ok, 0 FAIL;emit-go.test.mjs14/14; size budget exit 0 (six budgets raised with the reason); leak scan clean.a10). ABAP documentation: sy-tabix 0 for a hit by a hashed key, a miss undefined (0 is set).v<n>/ishadowable by ABAP names in both emitters, sy-tabix wording). All fixed: INTO conversion refused, temporaries spelledkV/kI/kR, fixture has a localv0and a table namedi.🤖 Generated with Claude Code
https://claude.ai/code/session_01VUy1x5QYimNEytFZpg7t7S