Skip to content

feat(pyamber): add workflow transport runtime - #8321

Closed
carloea2 wants to merge 1 commit into
apache:mainfrom
carloea2:codex/feat/pytexera-workflow-runtime
Closed

feat(pyamber): add workflow transport runtime#8321
carloea2 wants to merge 1 commit into
apache:mainfrom
carloea2:codex/feat/pytexera-workflow-runtime

Conversation

@carloea2

@carloea2 carloea2 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Add a small pytexera.workflow runtime for generated Python UDFs. It provides:

  • Cloudpickle encoding for selected Python values, including aliases and cycles;
  • explicit field-presence tracking;
  • boundary import and export helpers;
  • tuple-operator adapters used by generated UDF modules.

Cloudpickle payloads are internal workflow data. Deserialization remains inside Python UDF workers that already execute user-provided Python code; this API must not be used as a safe decoder for untrusted bytes.

Any related issues, documentation, discussions?

Related to #8319 and discussion #8160.

How was this PR tested?

python -m pytest amber/src/test/python/pytexera/workflow/test_codec.py amber/src/test/python/pytexera/workflow/test_operators.py amber/src/test/python/pytexera/workflow/test_runtime.py -q

Result: 22 passed.

The tests cover round trips, aliases, cycles, missing fields, malformed envelopes, boundary routing, and operator behavior.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: OpenAI Codex (GPT-5)

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file pyamber labels Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @aglinxinyuan
    You can notify them by mentioning @aglinxinyuan in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.96899% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.97%. Comparing base (fc7cfcd) to head (1090ffd).

Files with missing lines Patch % Lines
amber/src/main/python/pytexera/workflow/runtime.py 77.23% 16 Missing and 12 partials ⚠️
amber/src/main/python/pytexera/workflow/codec.py 65.51% 10 Missing and 10 partials ⚠️
...ber/src/main/python/pytexera/workflow/operators.py 81.08% 9 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8321      +/-   ##
============================================
- Coverage     94.07%   93.97%   -0.10%     
  Complexity     4814     4814              
============================================
  Files          1196     1200       +4     
  Lines         48713    48971     +258     
  Branches       5866     5910      +44     
============================================
+ Hits          45825    46021     +196     
- Misses         1436     1471      +35     
- Partials       1452     1479      +27     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from fc7cfcd
agent-service 99.32% <ø> (ø) Carriedforward from fc7cfcd
amber 90.12% <ø> (ø) Carriedforward from fc7cfcd
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from fc7cfcd
config-service 87.00% <ø> (ø) Carriedforward from fc7cfcd
file-service 87.91% <ø> (ø) Carriedforward from fc7cfcd
frontend 96.80% <ø> (ø) Carriedforward from fc7cfcd
notebook-migration-service 79.31% <ø> (ø) Carriedforward from fc7cfcd
pyamber 97.00% <75.96%> (-1.18%) ⬇️
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from fc7cfcd

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 4 better · 🔴 4 worse · ⚪ 7 noise (<±5%) · 0 without baseline

Compared against main fc7cfcd benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 459 0.28 20,275/29,804/29,804 us 🔴 +29.6% / 🔴 +87.4%
🟢 bs=100 sw=10 sl=64 995 0.607 98,788/109,842/109,842 us 🟢 -33.2% / 🟢 -9.1%
bs=1000 sw=10 sl=64 1,160 0.708 862,759/896,414/896,414 us ⚪ within ±5% / 🟢 -17.1%
Baseline details

Latest main fc7cfcd from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 459 tuples/sec 506 tuples/sec 750.65 tuples/sec -9.3% -38.9%
bs=10 sw=10 sl=64 MB/s 0.28 MB/s 0.309 MB/s 0.458 MB/s -9.4% -38.9%
bs=10 sw=10 sl=64 p50 20,275 us 20,498 us 13,049 us -1.1% +55.4%
bs=10 sw=10 sl=64 p95 29,804 us 23,000 us 15,902 us +29.6% +87.4%
bs=10 sw=10 sl=64 p99 29,804 us 23,000 us 19,184 us +29.6% +55.4%
bs=100 sw=10 sl=64 throughput 995 tuples/sec 944 tuples/sec 960.3 tuples/sec +5.4% +3.6%
bs=100 sw=10 sl=64 MB/s 0.607 MB/s 0.576 MB/s 0.586 MB/s +5.4% +3.6%
bs=100 sw=10 sl=64 p50 98,788 us 98,747 us 104,199 us +0.0% -5.2%
bs=100 sw=10 sl=64 p95 109,842 us 164,332 us 110,645 us -33.2% -0.7%
bs=100 sw=10 sl=64 p99 109,842 us 164,332 us 120,888 us -33.2% -9.1%
bs=1000 sw=10 sl=64 throughput 1,160 tuples/sec 1,149 tuples/sec 993.27 tuples/sec +1.0% +16.8%
bs=1000 sw=10 sl=64 MB/s 0.708 MB/s 0.702 MB/s 0.606 MB/s +0.9% +16.8%
bs=1000 sw=10 sl=64 p50 862,759 us 866,721 us 1,012,191 us -0.5% -14.8%
bs=1000 sw=10 sl=64 p95 896,414 us 911,599 us 1,054,057 us -1.7% -15.0%
bs=1000 sw=10 sl=64 p99 896,414 us 911,599 us 1,081,313 us -1.7% -17.1%
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,435.67,200,128000,459,0.280,20274.81,29804.24,29804.24
1,100,10,64,20,2010.71,2000,1280000,995,0.607,98787.63,109842.16,109842.16
2,1000,10,64,20,17241.00,20000,12800000,1160,0.708,862759.18,896414.09,896414.09

@carloea2
carloea2 marked this pull request as ready for review September 1, 2026 23:28
@carloea2 carloea2 closed this Sep 1, 2026
@carloea2
carloea2 deleted the codex/feat/pytexera-workflow-runtime branch September 1, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file pyamber

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants