[SERVER-72752] Add C++ CodeFragment pretty printing of stackSize and fixups Created: 11/Jan/23 Updated: 29/Oct/23 Resolved: 28/Feb/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Anna Wawrzyniak | Assignee: | Kevin Cherkauer |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
| Backwards Compatibility: | Fully Compatible |
| Sprint: | QE 2023-02-20, QE 2023-03-06 |
| Participants: |
| Description |
|
[
Add pretty printing of sbe CodeFragment for stackSize, maxStackSize and all fixups. Possibly something like suggested by david.percy@mongodb.com in https://github.com/10gen/mongo/pull/9493#discussion_r1060674192 https://github.com/10gen/mongo/pull/9493#discussion_r1060681436
Possibly something along the lines of:
|
| Comments |
| Comment by Githook User [ 25/Feb/23 ] |
|
Author: {'name': 'Kevin Cherkauer', 'email': 'kevin.cherkauer@mongodb.com', 'username': 'kevin-cherkauer'}Message: |
| Comment by Kevin Cherkauer [ 06/Feb/23 ] |
|
More info: Q1. What should the "stack effects" output capture? Anna Wawrzyniak: its a number that indicates how stack size will change after this code runs (so positive => the stack will be come larger, negative => stack will be smaller). Q2. Where is the C++ pretty printer? Anna Wawrzyniak: this is where printer lives |
| Comment by Anna Wawrzyniak [ 03/Feb/23 ] |
|
This change is mostly intended for in-process debugging rather than golden tests (although it's still beneficial for golden tests). The motivation is, that when working with a EExpression -> CodeFragment compilation it is often of interest to be able to inspect the CodeFragments in their partial forms. Normally, when EExpression is compiled, the finished CodeFragment has stack effect of 1 (the result of the expression that will be left on the stack), and has no remaining fixups (as otherwise it wouldn't be valid). However, during the compilation partial CodeFragments may have different overall stack effects and may have outstanding variable frames and variable references that need fixups. We would like to include, that in the pretty printing output. Ideally we would do the change to both c++ and python pretty printer. C++ is used for both debugging and golden tests, while python is only used for debugging. |