Skip to content

feat: preserve state marker dictionaries across runtimes - #8958

Merged
aglinxinyuan merged 2 commits into
apache:mainfrom
carloea2:codex/feature-state-marker-escape
Dec 1, 2026
Merged

aglinxinyuan merged 2 commits into
apache:mainfrom
carloea2:codex/feature-state-marker-escape

Conversation

@carloea2

@carloea2 carloea2 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Preserve user dictionaries containing __texera_type__ when state crosses Python and the JVM. Both codecs escape these dictionaries and only decode exact internal envelopes. The JVM also rejects malformed envelope payloads and non-object state content.

Any related issues, documentation, discussions?

Closes #8213. Replaces #8214.

How was this PR tested?

Six new JVM regression tests failed before the JVM change. After the change:

Check Result
sbt "WorkflowCore/testOnly *StateSpec" 18 passed
Python to JVM tuple to Python round trips 13 passed, including marker dictionaries, nested bytes, Unicode, empty state and loop metadata
python -m pytest src/test/python/core/models src/test/python/core/architecture/sendsemantics/test_partitioners.py --deselect src/test/python/core/models/test_tuple.py::TestTuple::test_hash -q --tb=short -p no:cacheprovider from amber 381 passed, 9 skipped, 1 xfailed; 2 known Windows timestamp-hash cases excluded, tracked separately in #8957
python -m ruff check src/main/python src/test/python from amber Passed
python -m ruff format --check src/main/python src/test/python from amber Passed
sbt "WorkflowCore/scalafix --check" "WorkflowCore/Test/scalafix --check" scalafmtCheckAll Passed

Tested in a detached worktree from main at 6db4a642d0. Local sbt runs reused ignored generated DAO sources with set DAO / Compile / sourceGenerators := Seq.empty instead of regenerating the database schema.

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

Generated-by: OpenAI Codex, GPT-6

@carloea2

Copy link
Copy Markdown
Contributor Author

This replaces stale-closed #8214. The problem still reproduces on current main. The patch passes its regression, 352 broader tests and Ruff checks.

/request-review @aglinxinyuan

@carloea2

Copy link
Copy Markdown
Contributor Author

/request-review @aglinxinyuan

@github-actions

github-actions Bot commented Oct 12, 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

codecov-commenter commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.78%. Comparing base (793deea) to head (7fe991a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8958      +/-   ##
============================================
- Coverage     91.79%   91.78%   -0.01%     
- Complexity     5133     5135       +2     
============================================
  Files          1309     1309              
  Lines         58119    58047      -72     
  Branches       7569     7556      -13     
============================================
- Hits          53351    53281      -70     
  Misses         2879     2879              
+ Partials       1889     1887       -2     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.56% <ø> (ø) Carriedforward from c7d8854
amber 85.95% <ø> (+0.01%) ⬆️ Carriedforward from c7d8854
computing-unit-managing-service 63.84% <ø> (ø)
config-service 87.50% <ø> (ø)
file-service 82.16% <ø> (ø)
frontend 96.49% <ø> (-0.01%) ⬇️ Carriedforward from c7d8854
notebook-migration-service 83.84% <ø> (ø)
pyamber 98.64% <100.00%> (-0.07%) ⬇️
result-service 86.48% <ø> (ø)
workflow-compiling-service 80.90% <ø> (ø)

*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 Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 793deea 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 638 0.389 13,787/26,012/26,012 us 🔴 +10.2% / 🔴 +109.6%
🔴 bs=100 sw=10 sl=64 1,652 1.008 60,227/70,941/70,941 us 🟢 -14.1% / 🟢 -23.7%
⚪ bs=1000 sw=10 sl=64 1,940 1.184 512,609/577,106/577,106 us ⚪ within ±5% / 🟢 +31.5%
Baseline details

Latest main 793deea from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 638 tuples/sec 675 tuples/sec 1,038 tuples/sec -5.5% -38.5%
bs=10 sw=10 sl=64 MB/s 0.389 MB/s 0.412 MB/s 0.633 MB/s -5.6% -38.6%
bs=10 sw=10 sl=64 p50 13,787 us 12,509 us 9,627 us +10.2% +43.2%
bs=10 sw=10 sl=64 p95 26,012 us 28,220 us 12,408 us -7.8% +109.6%
bs=10 sw=10 sl=64 p99 26,012 us 28,220 us 15,894 us -7.8% +63.7%
bs=100 sw=10 sl=64 throughput 1,652 tuples/sec 1,709 tuples/sec 1,429 tuples/sec -3.3% +15.6%
bs=100 sw=10 sl=64 MB/s 1.008 MB/s 1.043 MB/s 0.872 MB/s -3.4% +15.6%
bs=100 sw=10 sl=64 p50 60,227 us 56,625 us 73,548 us +6.4% -18.1%
bs=100 sw=10 sl=64 p95 70,941 us 82,573 us 80,385 us -14.1% -11.7%
bs=100 sw=10 sl=64 p99 70,941 us 82,573 us 93,011 us -14.1% -23.7%
bs=1000 sw=10 sl=64 throughput 1,940 tuples/sec 1,988 tuples/sec 1,475 tuples/sec -2.4% +31.5%
bs=1000 sw=10 sl=64 MB/s 1.184 MB/s 1.214 MB/s 0.9 MB/s -2.5% +31.5%
bs=1000 sw=10 sl=64 p50 512,609 us 499,742 us 716,311 us +2.6% -28.4%
bs=1000 sw=10 sl=64 p95 577,106 us 562,941 us 757,389 us +2.5% -23.8%
bs=1000 sw=10 sl=64 p99 577,106 us 562,941 us 803,619 us +2.5% -28.2%
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,313.43,200,128000,638,0.389,13786.78,26012.26,26012.26
1,100,10,64,20,1210.71,2000,1280000,1652,1.008,60226.57,70941.36,70941.36
2,1000,10,64,20,10311.61,20000,12800000,1940,1.184,512608.70,577106.26,577106.26

@carloea2
carloea2 force-pushed the codex/feature-state-marker-escape branch from 1e9079e to 834d3bb Compare October 15, 2026 06:43
@carloea2

Copy link
Copy Markdown
Contributor Author

/request-review @sshiv012 @parshimers

@carloea2
carloea2 force-pushed the codex/feature-state-marker-escape branch from 834d3bb to 46a24eb Compare November 11, 2026 02:35
@carloea2 carloea2 changed the title feat(pyamber): escape state marker collisions feat: preserve state marker dictionaries across runtimes Nov 11, 2026

@eugenegujing eugenegujing left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Nov 30, 2026
Merged via the queue into apache:main with commit 7a47c75 Dec 1, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State byte markers can overwrite user dictionaries

4 participants