Repository navigation
test(pyamber): build expression evaluator expectations with one helper - #9731
Open
aglinxinyuan wants to merge 1 commit into
Open
aglinxinyuan wants to merge 1 commit into
aglinxinyuan wants to merge 1 commit into
Conversation
test_expression_evaluator.py wrote out every expected TypedValue in full, including the __getitem__ expression of each indexed child. A module-level helper now builds them from the value reference, text, type and expandability, which stay literal in each case. The handler spec patches the evaluator once in a fixture instead of in every case.
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9731 +/- ##
============================================
- Coverage 91.77% 91.77% -0.01%
Complexity 5136 5136
============================================
Files 1308 1308
Lines 58048 58048
Branches 7558 7558
============================================
- Hits 53274 53271 -3
- Misses 2887 2889 +2
- Partials 1887 1888 +1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 451 | 0.276 | 21,041/34,234/34,234 us | 🔴 -7.2% / 🔴 +152.3% |
| 🟢 | bs=100 sw=10 sl=64 | 979 | 0.598 | 101,376/115,371/115,371 us | 🟢 -20.3% / 🔴 +26.2% |
| 🔴 | bs=1000 sw=10 sl=64 | 1,132 | 0.691 | 875,287/1,043,398/1,043,398 us | 🔴 +16.3% / 🔴 +21.4% |
Baseline details
Latest main 923c982 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 451 tuples/sec | 486 tuples/sec | 951.49 tuples/sec | -7.2% | -52.6% |
| bs=10 sw=10 sl=64 | MB/s | 0.276 MB/s | 0.297 MB/s | 0.581 MB/s | -7.1% | -52.5% |
| bs=10 sw=10 sl=64 | p50 | 21,041 us | 19,945 us | 10,659 us | +5.5% | +97.4% |
| bs=10 sw=10 sl=64 | p95 | 34,234 us | 33,356 us | 13,570 us | +2.6% | +152.3% |
| bs=10 sw=10 sl=64 | p99 | 34,234 us | 33,356 us | 16,744 us | +2.6% | +104.5% |
| bs=100 sw=10 sl=64 | throughput | 979 tuples/sec | 975 tuples/sec | 1,256 tuples/sec | +0.4% | -22.1% |
| bs=100 sw=10 sl=64 | MB/s | 0.598 MB/s | 0.595 MB/s | 0.767 MB/s | +0.5% | -22.0% |
| bs=100 sw=10 sl=64 | p50 | 101,376 us | 102,488 us | 84,170 us | -1.1% | +20.4% |
| bs=100 sw=10 sl=64 | p95 | 115,371 us | 144,751 us | 91,401 us | -20.3% | +26.2% |
| bs=100 sw=10 sl=64 | p99 | 115,371 us | 144,751 us | 104,021 us | -20.3% | +10.9% |
| bs=1000 sw=10 sl=64 | throughput | 1,132 tuples/sec | 1,173 tuples/sec | 1,299 tuples/sec | -3.5% | -12.9% |
| bs=1000 sw=10 sl=64 | MB/s | 0.691 MB/s | 0.716 MB/s | 0.793 MB/s | -3.5% | -12.8% |
| bs=1000 sw=10 sl=64 | p50 | 875,287 us | 850,411 us | 819,011 us | +2.9% | +6.9% |
| bs=1000 sw=10 sl=64 | p95 | 1,043,398 us | 896,960 us | 859,723 us | +16.3% | +21.4% |
| bs=1000 sw=10 sl=64 | p99 | 1,043,398 us | 896,960 us | 909,957 us | +16.3% | +14.7% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,442.99,200,128000,451,0.276,21040.96,34234.03,34234.03
1,100,10,64,20,2042.34,2000,1280000,979,0.598,101376.38,115370.93,115370.93
2,1000,10,64,20,17663.66,20000,12800000,1132,0.691,875286.87,1043398.34,1043398.34This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
test_expression_evaluator.pybuilds its expectedTypedValues with one module-level_expected_value(value_ref, value_str, value_type, expandable, item=False). The value reference, text, type and expandability stay literal in every case. Only the expression is derived:__getitem__(<ref>)for an indexed child, or the reference itself otherwise. The two dictionary children with non-numeric keys,'b'and(10,), keep their explicit constructors, so the quoting of their keys stays visible.test_evaluate_expression_handler.pypatches the evaluator once in anevaluatorfixture, and each case sets the return value or side effect it needs.Every case keeps its name, inputs and expected values, in the same order.
Any related issues, documentation, discussions?
Closes #9730.
How was this PR tested?
python:3.12-slimwithamber/requirements.txt,amber/dev-requirements.txtand the bindings frombin/python-proto-gen.sh,cd amber && python -m pytest src/test/python/core/util/test_expression_evaluator.py src/test/python/core/architecture/handlers/control/test_evaluate_expression_handler.py: main and this branch each pass all 10 cases, with the same names, outcomes and order, compared from the JUnit XML reports.expression_evaluator.pynaming indexed children__item__(...)instead of__getitem__(...):test_evaluate_str_expressionandtest_evaluate_container_expressions.expression_evaluator.pybuildingvalue_strwithstrinstead ofrepr:test_evaluate_str_expression.evaluate_expression_handler.pypassing the current tuple asinput_:test_runtime_context_exposes_self_tuple_inputandtest_runtime_context_reflects_current_tuple_at_call_time.ruff checkandruff format --checkon both files.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-6) and Claude Code (Claude Opus 5.5)