Skip to content

feat(pyamber): escape state marker collisions - #8958

Open
carloea2 wants to merge 1 commit into
apache:mainfrom
carloea2:codex/feature-state-marker-escape
Open

carloea2 wants to merge 1 commit 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 the internal type marker during state serialization. Escape those dictionaries and decode only exact internal envelopes so user fields survive the round trip.

Any related issues, documentation, discussions?

Closes #8213

Replaces #8214, which the stale bot closed. The original PR cannot be reopened by this account.

How was this PR tested?

Retested with Python 3.12 on Windows in a fresh detached worktree from upstream main at 7426431337, which includes the merged loop-completion change #8938. Regression before implementation: 2 failed, 16 passed. After implementation: 356 passed, 2 deselected, 1 expected failure.

The merged non-string state-key validation is preserved. The two deselected tests belong to the existing Windows pre-epoch hash fixture covered by #8957.

Generate protobufs with bash bin/python-proto-gen.sh, then run from amber:

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=line -p no:cacheprovider
python -m ruff check src/main/python src/test/python
python -m ruff format --check src/main/python src/test/python

Ruff lint and formatting pass for all 217 Python files.

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

Generated-by: 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:

  • No candidates found from git blame history.

@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 92.31%. Comparing base (7426431) to head (834d3bb).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8958   +/-   ##
=========================================
  Coverage     92.30%   92.31%           
  Complexity     5046     5046           
=========================================
  Files          1260     1260           
  Lines         53887    53894    +7     
  Branches       6711     6713    +2     
=========================================
+ Hits          49743    49750    +7     
  Misses         2486     2486           
  Partials       1658     1658           
Flag Coverage Δ *Carryforward flag
access-control-service 77.38% <ø> (ø) Carriedforward from 7426431
agent-service 99.16% <ø> (ø) Carriedforward from 7426431
amber 87.32% <ø> (ø) Carriedforward from 7426431
computing-unit-managing-service 60.48% <ø> (ø) Carriedforward from 7426431
config-service 87.37% <ø> (ø) Carriedforward from 7426431
file-service 82.00% <ø> (ø) Carriedforward from 7426431
frontend 96.55% <ø> (ø) Carriedforward from 7426431
notebook-migration-service 83.73% <ø> (ø) Carriedforward from 7426431
pyamber 98.54% <100.00%> (+<0.01%) ⬆️
workflow-compiling-service 72.43% <ø> (ø) Carriedforward from 7426431

*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

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

Compared against main 7426431 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 392 0.24 25,258/30,693/30,693 us 🔴 -5.3% / 🔴 +108.2%
⚪ bs=100 sw=10 sl=64 792 0.484 124,264/154,014/154,014 us ⚪ within ±5% / 🔴 +47.8%
⚪ bs=1000 sw=10 sl=64 911 0.556 1,094,500/1,168,440/1,168,440 us ⚪ within ±5% / 🔴 +18.6%
Baseline details

Latest main 7426431 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 392 tuples/sec 414 tuples/sec 822.11 tuples/sec -5.3% -52.3%
bs=10 sw=10 sl=64 MB/s 0.24 MB/s 0.252 MB/s 0.502 MB/s -4.8% -52.2%
bs=10 sw=10 sl=64 p50 25,258 us 25,140 us 12,129 us +0.5% +108.2%
bs=10 sw=10 sl=64 p95 30,693 us 30,281 us 15,469 us +1.4% +98.4%
bs=10 sw=10 sl=64 p99 30,693 us 30,281 us 18,357 us +1.4% +67.2%
bs=100 sw=10 sl=64 throughput 792 tuples/sec 822 tuples/sec 1,058 tuples/sec -3.6% -25.1%
bs=100 sw=10 sl=64 MB/s 0.484 MB/s 0.502 MB/s 0.646 MB/s -3.6% -25.0%
bs=100 sw=10 sl=64 p50 124,264 us 119,814 us 97,399 us +3.7% +27.6%
bs=100 sw=10 sl=64 p95 154,014 us 152,761 us 104,184 us +0.8% +47.8%
bs=100 sw=10 sl=64 p99 154,014 us 152,761 us 117,615 us +0.8% +30.9%
bs=1000 sw=10 sl=64 throughput 911 tuples/sec 929 tuples/sec 1,099 tuples/sec -1.9% -17.1%
bs=1000 sw=10 sl=64 MB/s 0.556 MB/s 0.567 MB/s 0.671 MB/s -1.9% -17.1%
bs=1000 sw=10 sl=64 p50 1,094,500 us 1,074,060 us 946,743 us +1.9% +15.6%
bs=1000 sw=10 sl=64 p95 1,168,440 us 1,167,175 us 985,437 us +0.1% +18.6%
bs=1000 sw=10 sl=64 p99 1,168,440 us 1,167,175 us 1,012,622 us +0.1% +15.4%
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,509.63,200,128000,392,0.240,25257.84,30692.91,30692.91
1,100,10,64,20,2524.08,2000,1280000,792,0.484,124264.35,154013.77,154013.77
2,1000,10,64,20,21955.36,20000,12800000,911,0.556,1094500.18,1168440.13,1168440.13

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

This branch has not been deployed

No deployments
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

2 participants