Skip to content

fix: Fix mismatched ListValue serialization format - #3250

Open
aborgna-q wants to merge 1 commit into
mainfrom
ab/list-value-serialization
Open

aborgna-q wants to merge 1 commit into
mainfrom
ab/list-value-serialization

Conversation

@aborgna-q

Copy link
Copy Markdown
Collaborator

No description provided.

@aborgna-q
aborgna-q requested a review from acl-cqc September 8, 2026 12:41
@aborgna-q
aborgna-q requested a review from a team as a code owner September 8, 2026 12:41
@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.88%. Comparing base (77816c4) to head (60211b6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3250      +/-   ##
==========================================
+ Coverage   81.73%   81.88%   +0.14%     
==========================================
  Files         242      242              
  Lines       47884    46827    -1057     
  Branches    41477    40420    -1057     
==========================================
- Hits        39139    38344     -795     
+ Misses       6723     6589     -134     
+ Partials     2022     1894     -128     
Flag Coverage Δ
python 89.46% <100.00%> (+0.07%) ⬆️
rust 80.68% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. 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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aborgna-q aborgna-q mentioned this pull request Sep 29, 2026

@acl-cqc acl-cqc 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.

The fix is one line of python, the legacy workaround is a bunch of Rust (ok!), most of it is test, which is also fine....but I do wonder if there's anything we can do to make the tests less low-level / full of JSON details. Could we test serializing from python and then loading it from Rust, say? Or even just add an artefact of JSON from before this PR?

I've tried this on my test cases - taking my guppy-generated Hugr and deserializing in Rust, which previously failed, does now work if I upgrade/patch either guppy or the deserializer, so ok, yes, looks good to me.

#[case::populated(vec![ConstUsize::new(42).into()])]
fn wire_format(#[case] contents: Vec<Value>, #[values(false, true)] named: bool) {
let expected = ListValue::new(usize_t(), contents.clone());
let payload = if named {

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.

I mean, if ListValueWire derived serde::Serialize, you could do this without writing these json! in the test, right? Is there any reason not to make ListValueWire serialize? It is private, after all... (ah, you might have to call it ListValue and put it in a submodule?)

Ideal would then be to have some example json as it appears in a file in another test, but you could do just one example like that

@acl-cqc acl-cqc 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.

Did get my test cases working, as per previous message, so 🚀 (perhaps tests can be simplified!?)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants