Skip to content

gogen: compile += -= *= /= &&= as calculation assignments - #1022

Merged
oisee merged 1 commit into
mainfrom
fix/gogen-calc-assign
Nov 28, 2026
Merged

oisee merged 1 commit into
mainfrom
fix/gogen-calc-assign

Conversation

@oisee

@oisee oisee commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

lv_i += 5. compiled as lv_i = 5. in gogen, on both emitters (Go and IR-JS); -=, *=, /= and &&= the same. The Move branch read the target and the source and never the operator. No error, only a wrong value.

before after (= Node / @abaplint/transpiler)
lv_i = 10. lv_i += 5. 5 15
lv_s = 'ab'. lv_s &&= 'cd'. cd abcd

Where it bites in the tree: packs/rap-flight numbers its keys with travel_id_max += 1 and sums total_price += ..., so under gogen every new ID would come out 1 and each total would hold only its last amount (read off the code, not run).

Change

  • tools/gogen/frontend-calc-assign.mjs (new): a op= b is a = a op ( b ) with the calculation type of ADD / SUBTRACT / MULTIPLY / DIVIDE (keyword documentation, calculation assignments); a &&= b is a = a && b into a c or string target. abaplint lexes += and -= as two tokens, so the operator is the text between target and source. An operator the branch does not know is refused instead of being compiled as =.
  • The arithmetic statements use the same arithAssign, so the calculation-type rule is written once (frontend.mjs -6 net lines, under its size budget).

Tests

  • testdata/zcl_gogen_t_calcassign: 11 cases (+= -= *= /= on i, rounding 7 /= 2, an expression operand, i += '2.6', int8, packed, &&= on string and c). The expectation 15/12/24/6/4/9/13/2147483650/8.17/abcd/abxy was measured on Node with @abaplint/transpiler; A4H not run.
  • Before the fix, the same test fails on both emitters with 5/3/2/4/2/5/3/2147483647/3.00/cd/xy.
  • node tools/gogen/semantics.mjs: all 515 ok; the frontend node --test set of the gogen workflow: 194/194; tsc -p tsconfig.gogen.json clean.

Seen on the way, not fixed here

🤖 Generated with Claude Code

https://claude.ai/code/session_011FwUR7MRXbhsfstiNhVu8t

The Move branch read the target and the source and never the operator,
so lv_i += 5 compiled as lv_i = 5 (and &&= as a plain assignment) on
both emitters. a op= b is now a = a op ( b ) with the calculation type
of ADD / SUBTRACT / MULTIPLY / DIVIDE, and a &&= b is a = a && b into a
c or string target. abaplint lexes += and -= as two tokens, so the
operator is the text between target and source; an operator the branch
does not know is refused instead of compiled as =.

The rule lives in frontend-calc-assign.mjs, which the arithmetic
statements now share (frontend.mjs -33 lines, under its budget).

ZCL_GOGEN_T_CALCASSIGN: 11 cases, expectation measured on Node with
@abaplint/transpiler; fails on main with 5/3/2/4/2/5/3/2147483647/3.00/cd/xy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011FwUR7MRXbhsfstiNhVu8t
@github-actions

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 f85db3b

@github-actions

Copy link
Copy Markdown
Contributor

PR tests: 🟢 pass

Commit: 4f301df1 · Full test log

Job Result Time
build 🟢 pass 282 s
adt-lifecycle 🟢 pass 1685 s
packaging 🟢 pass 303 s
kernel-conformance 🟢 pass 125 s
e2e 🟢 pass 170 s
osgo-host 🟢 pass 588 s
suites (2) 🟢 pass 1405 s
suites (6) 🟢 pass 1418 s
suites (3) 🟢 pass 1068 s
suites (4) 🟢 pass 1530 s
suites (5) 🟢 pass 1024 s
suites (1) 🟢 pass 1096 s

Suite retries

  • flaky / order-dependent: test/mocha.mjs — test/mocha.mjs wire POST, PUT, DELETE round trip through the DPC (passed once in isolation)
  • flaky / order-dependent: test/webgui.mjs — test/webgui.mjs webgui: Easy Success, the screen SAP calls Easy Access prints the system, the work process, the client and the user the rest of the system reports (passed once in isolation)

ADT lifecycle: PASS

Commit: f85db3b · SDK 8.4.3 · VSP baac6f4c97fb3ea1dee9b7772e24d52855af2985

126 PASS, 4 N/A, 1 MISSING

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

Timing advisory: ⚠️ WARN

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 32.5 ms.

History: 2/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.

  • Advisory timing slowdown: 7 operations above 1.3x; ABAP-FS/CLAS/check: 2408 ms, main 2507.5 ms, normalized 1.475x; ABAP-FS/CLAS/activate-edit: 3604 ms, main 3933 ms, normalized 1.433x; ABAP-FS/INTF/check: 2436 ms, main 2545 ms, normalized 1.481x; ABAP-FS/INTF/activate-edit: 3600 ms, main 4093 ms, normalized 1.385x; ABAP-FS/PROG/edit: 74 ms, main 84.5 ms, normalized 1.435x; VSP/CLAS/edit+check+activate: 6218 ms, main 6877.5 ms, normalized 1.417x; VSP/INTF/edit+check+activate: 6361 ms, main 6763 ms, normalized 1.452x
  • Main run 45726610002: Incompatible baseline identity: runtime
  • Main run 45672746165: Incompatible baseline identity: runtime
  • Main run 45650642127: Incompatible baseline identity: runtime
  • Main run 44444071792: Incompatible baseline identity: runtime
  • Main run 44433960957: Incompatible baseline identity: runtime
  • Main run 44428625441: Incompatible baseline identity: runtime
  • Main run 44412101142: Incompatible baseline identity: runtime
  • Main run 44406337099: Incompatible baseline identity: runtime
  • Main run 44212157870: Incompatible baseline identity: runtime
  • Main run 44167393683: Incompatible baseline identity: runtime
  • Main run 44137578990: Incompatible baseline identity: runtime
  • Main run 43891819303: Incompatible baseline identity: runtime
  • Main run 43866547128: Incompatible baseline identity: runtime
  • Main run 43850018436: Incompatible baseline identity: runtime
  • Main run 43819782682: Incompatible baseline identity: runtime
  • Main run 43813132781: Incompatible baseline identity: runtime
  • Main run 43797820052: Incompatible baseline identity: runtime
  • Main run 43738560303: Incompatible baseline identity: runtime
  • Main run 43722958989: Incompatible baseline identity: runtime
  • Main run 43707808472: Incompatible baseline identity: runtime
  • Main run 43696610859: Incompatible baseline identity: runtime
  • Main run 43691896060: Incompatible baseline identity: runtime
  • Main run 43687902615: Incompatible baseline identity: runtime
  • Main run 43679730582: Incompatible baseline identity: runtime
  • Main run 43675046568: Incompatible baseline identity: runtime
  • Main run 43669365582: Incompatible baseline identity: runtime
  • Main run 43663673442: Incompatible baseline identity: runtime
  • Main run 43654640548: Incompatible baseline identity: runtime
Client/type/operation Median ms Samples ms main ms (raw median) Current/reference main normalized median Ratio Main runs Timing
ABAP-FS/CLAS/edit 54 96, 54, 45 76 1.662 1.427 1.164x 2 quiet
ABAP-FS/CLAS/check 2408 2071, 2408, 2696 2508 74.092 50.220 1.475x 2 above margin
ABAP-FS/CLAS/activate-edit 3604 3254, 3604, 3796 3933 110.892 77.409 1.433x 2 above margin
ABAP-FS/CLAS/readback-active 19 30, 19, 18 31 0.585 0.573 1.020x 2 quiet
ABAP-FS/INTF/edit 46 44, 58, 46 89 1.415 1.689 0.838x 2 quiet
ABAP-FS/INTF/check 2436 2436, 2364, 2816 2545 74.954 50.621 1.481x 2 above margin
ABAP-FS/INTF/activate-edit 3600 3600, 3735, 3511 4093 110.769 79.962 1.385x 2 above margin
ABAP-FS/INTF/readback-active 13 60, 13, 13 22 0.400 0.402 0.996x 2 quiet
ABAP-FS/PROG/edit 74 47, 74, 194 85 2.277 1.587 1.435x 2 above margin
ABAP-FS/PROG/check 8365 10618, 8365, 8091 11744 257.385 221.647 1.161x 2 quiet
ABAP-FS/PROG/activate-edit 50774 56385, 50774, 49460 69305 1562.277 1306.555 1.196x 2 quiet
ABAP-FS/PROG/readback-active 51 50, 51, 51 76 1.569 1.403 1.118x 2 quiet
ABAP-FS/INCL/edit 64 69, 64, 60 89 1.969 1.685 1.169x 2 quiet
ABAP-FS/INCL/check 10806 8516, 10870, 10806 13897 332.492 264.020 1.259x 2 quiet
ABAP-FS/INCL/activate-edit 7917 7127, 7917, 8046 10776 243.600 202.563 1.203x 2 quiet
ABAP-FS/INCL/readback-active 22 25, 18, 22 29 0.677 0.538 1.258x 2 quiet
ABAP-FS/DDLS/edit 65 49, 69, 65 94 2.000 1.803 1.109x 2 quiet
ABAP-FS/DDLS/check 6333 8160, 6333, 6314 9963 194.862 187.554 1.039x 2 quiet
ABAP-FS/DDLS/activate-edit 52265 53621, 52128, 52265 74438 1608.154 1413.379 1.138x 2 quiet
ABAP-FS/DDLS/readback-active 56 58, 53, 56 78 1.723 1.478 1.165x 2 quiet
VSP/CLAS/edit+check+activate 6218 5707, 6218, 6695 6878 191.323 135.042 1.417x 2 above margin
VSP/INTF/edit+check+activate 6361 5414, 6361, 6876 6763 195.723 134.812 1.452x 2 above margin
VSP/PROG/edit+check+activate 57298 57766, 57298, 57198 73743 1763.015 1384.510 1.273x 2 quiet
VSP/INCL/edit+check+activate 12528 12082, 14270, 12528 16719 385.477 319.879 1.205x 2 quiet
VSP/DDLS/edit+check+activate 60732 60732, 63465, 60292 79027 1868.677 1470.907 1.270x 2 quiet
Client Type Operation Result ms Note
ABAP-FS DEVC validate PASS 22
ABAP-FS DEVC create PASS 75
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 17
ABAP-FS CLAS create PASS 67
ABAP-FS CLAS write-initial PASS 57
ABAP-FS INTF validate PASS 13
ABAP-FS INTF create PASS 26
ABAP-FS INTF write-initial PASS 48
ABAP-FS PROG validate PASS 15
ABAP-FS PROG create PASS 34
ABAP-FS PROG write-initial PASS 44
ABAP-FS INCL validate PASS 9
ABAP-FS INCL create PASS 4596
ABAP-FS INCL write-initial PASS 643
ABAP-FS DDLS validate MISSING 8 /sap/bc/adt/ddic/ddl/validation is not served by OSD
ABAP-FS DDLS create PASS 26
ABAP-FS DDLS write-initial PASS 44
ABAP-FS ALL5 activate-initial PASS 41329
ABAP-FS CLAS edit #1 PASS 96
ABAP-FS CLAS check #1 PASS 2071
ABAP-FS CLAS activate-edit #1 PASS 3254
ABAP-FS CLAS readback-active #1 PASS 30
ABAP-FS CLAS edit #2 PASS 54
ABAP-FS CLAS check #2 PASS 2408
ABAP-FS CLAS activate-edit #2 PASS 3604
ABAP-FS CLAS readback-active #2 PASS 19
ABAP-FS CLAS edit #3 PASS 45
ABAP-FS CLAS check #3 PASS 2696
ABAP-FS CLAS activate-edit #3 PASS 3796
ABAP-FS CLAS readback-active #3 PASS 18
ABAP-FS INTF edit #1 PASS 44
ABAP-FS INTF check #1 PASS 2436
ABAP-FS INTF activate-edit #1 PASS 3600
ABAP-FS INTF readback-active #1 PASS 60
ABAP-FS INTF prepare-baseline PASS 32040
ABAP-FS INTF edit #2 PASS 58
ABAP-FS INTF check #2 PASS 2364
ABAP-FS INTF activate-edit #2 PASS 3735
ABAP-FS INTF readback-active #2 PASS 13
ABAP-FS INTF edit #3 PASS 46
ABAP-FS INTF check #3 PASS 2816
ABAP-FS INTF activate-edit #3 PASS 3511
ABAP-FS INTF readback-active #3 PASS 13
ABAP-FS PROG edit #1 PASS 47
ABAP-FS PROG check #1 PASS 10618
ABAP-FS PROG activate-edit #1 PASS 56385
ABAP-FS PROG readback-active #1 PASS 50
ABAP-FS PROG edit #2 PASS 74
ABAP-FS PROG check #2 PASS 8365
ABAP-FS PROG activate-edit #2 PASS 50774
ABAP-FS PROG readback-active #2 PASS 51
ABAP-FS PROG edit #3 PASS 194
ABAP-FS PROG check #3 PASS 8091
ABAP-FS PROG activate-edit #3 PASS 49460
ABAP-FS PROG readback-active #3 PASS 51
ABAP-FS INCL edit #1 PASS 69
ABAP-FS INCL check #1 PASS 8516
ABAP-FS INCL activate-edit #1 PASS 7127
ABAP-FS INCL readback-active #1 PASS 25
ABAP-FS INCL edit #2 PASS 64
ABAP-FS INCL check #2 PASS 10870
ABAP-FS INCL activate-edit #2 PASS 7917
ABAP-FS INCL readback-active #2 PASS 18
ABAP-FS INCL edit #3 PASS 60
ABAP-FS INCL check #3 PASS 10806
ABAP-FS INCL activate-edit #3 PASS 8046
ABAP-FS INCL readback-active #3 PASS 22
ABAP-FS DDLS edit #1 PASS 49
ABAP-FS DDLS check #1 PASS 8160
ABAP-FS DDLS activate-edit #1 PASS 53621
ABAP-FS DDLS readback-active #1 PASS 58
ABAP-FS DDLS edit #2 PASS 69
ABAP-FS DDLS check #2 PASS 6333
ABAP-FS DDLS activate-edit #2 PASS 52128
ABAP-FS DDLS readback-active #2 PASS 53
ABAP-FS DDLS edit #3 PASS 65
ABAP-FS DDLS check #3 PASS 6314
ABAP-FS DDLS activate-edit #3 PASS 52265
ABAP-FS DDLS readback-active #3 PASS 56
VSP DEVC create PASS 60
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 38908
VSP CLAS edit+check+activate #1 PASS 5707
VSP CLAS edit+check+activate #2 PASS 6218
VSP CLAS edit+check+activate #3 PASS 6695
VSP CLAS check-explicit PASS 2437
VSP CLAS activate-explicit PASS 2762
VSP CLAS readback-vsp PASS 15
VSP INTF create+write+activate PASS 58705
VSP INTF edit+check+activate #1 PASS 5414
VSP INTF edit+check+activate #2 PASS 6361
VSP INTF edit+check+activate #3 PASS 6876
VSP INTF check-explicit PASS 2517
VSP INTF activate-explicit PASS 2851
VSP INTF readback-vsp PASS 38
VSP PROG create+write+activate PASS 57501
VSP PROG edit+check+activate #1 PASS 57766
VSP PROG edit+check+activate #2 PASS 57298
VSP PROG edit+check+activate #3 PASS 57198
VSP PROG check-explicit PASS 4687
VSP PROG activate-explicit PASS 24648
VSP PROG readback-vsp PASS 78
VSP INCL create+write+activate PASS 57099
VSP INCL edit+check+activate #1 PASS 12082
VSP INCL edit+check+activate #2 PASS 14270
VSP INCL edit+check+activate #3 PASS 12528
VSP INCL check-explicit PASS 2599
VSP INCL activate-explicit PASS 7073
VSP INCL readback-vsp PASS 20
VSP DDLS create+write+activate PASS 54857
VSP DDLS edit+check+activate #1 PASS 60732
VSP DDLS edit+check+activate #2 PASS 63465
VSP DDLS edit+check+activate #3 PASS 60292
VSP DDLS check-explicit PASS 3985
VSP DDLS activate-explicit PASS 24070
VSP DDLS readback-vsp PASS 24
VSP DDLS delete+confirmed-404 PASS 64
VSP INCL delete+confirmed-404 PASS 2118
VSP PROG delete+confirmed-404 PASS 41
VSP INTF delete+confirmed-404 PASS 46
VSP CLAS delete+confirmed-404 PASS 37
VSP DEVC delete+confirmed-404 PASS 40
ABAP-FS DDLS delete+confirmed-404 PASS 40
ABAP-FS INCL delete+confirmed-404 PASS 1958
ABAP-FS PROG delete+confirmed-404 PASS 39
ABAP-FS INTF delete+confirmed-404 PASS 34
ABAP-FS CLAS delete+confirmed-404 PASS 31
ABAP-FS DEVC delete+confirmed-404 PASS 31

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 99a69f0 into main Nov 28, 2026
33 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