Skip to content

Validate graph, set-system, and database deserialization - #1161

Merged
GiggleLiu merged 4 commits into
mainfrom
fix/set-model-deserialization
Sep 18, 2026
Merged

GiggleLiu merged 4 commits into
mainfrom
fix/set-model-deserialization

Conversation

@isPANN

@isPANN isPANN commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Reuse constructor validation when loading five graph topologies, seven set-system models, and five database/query models.
  • Normalize persisted inputs through the same construction path and remove duplicated create checks.
  • Reject invalid attribute indices, relation arities, query arguments, and database frequency-table inputs during JSON loading.
  • Preserve public constructors, solver and reduction interfaces, JSON field names, and existing planar edge-bound semantics (not a new planarity algorithm).
  • Scope: 35 files, 936 additions; based on main.

Verification

  • Workspace all-feature unit and integration tests: 6,495 passed, 2 ignored.
  • Changed-line coverage against main: 100% (656 instrumented lines).
  • Workspace all-target all-feature Clippy, formatting, and whitespace checks pass.

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.97%. Comparing base (7dd5fcd) to head (dc4a670).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1161      +/-   ##
==========================================
+ Coverage   95.93%   95.97%   +0.04%     
==========================================
  Files        1074     1074              
  Lines      132106   132470     +364     
==========================================
+ Hits       126730   127144     +414     
+ Misses       5376     5326      -50     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@isPANN isPANN changed the title Validate set model inputs during deserialization Validate graph and set-system deserialization Sep 17, 2026
@isPANN isPANN changed the title Validate graph and set-system deserialization Validate graph, set-system, and database deserialization Sep 17, 2026
@GiggleLiu

Copy link
Copy Markdown
Contributor

Follow-up items (recorded during final review, applies to the whole validation series #1161/#1162/#1164/#1166/#1168/#1169):

  • The new fn try_new constructors are private. Some models already expose pub fn try_new (e.g. SetSplitting, ThreePartition), and reductions use it to propagate target-construction errors instead of panicking. Consider making the new ones pub with a doc comment so downstream code and reductions can construct these types fallibly.
  • New tests use mixed naming (json_rejects_invalid_instance, deserialize_checks_the_edge_bound, ...). The repo convention is a test_ prefix.

@GiggleLiu GiggleLiu 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.

Final review: every rejection traced to an existing assert; JSON shapes preserved; make check passes locally on the merged state. Approving as-is; follow-up note posted.

@GiggleLiu
GiggleLiu merged commit 4ceac5a into main Sep 18, 2026
9 checks passed
@isPANN
isPANN deleted the fix/set-model-deserialization branch September 18, 2026 10:22
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