Skip to content

Fix three-way-merge to be field-sensitive with --vsd-structs every-field#8805

Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-6272-three-way-merge-field-sensitive
Open

Fix three-way-merge to be field-sensitive with --vsd-structs every-field#8805
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-6272-three-way-merge-field-sensitive

Conversation

@tautschnig
Copy link
Collaborator

For structs with struct-typed fields, merging now recursively descends to identify leaf-level modifications. Array handling uses a conservative approach (marking entire array as modified) since enumerating all indices is not practical.

Co-authored-by: Kiro autonomous agent

Fixes: #6272

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 97.67442% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.01%. Comparing base (b191cc1) to head (f8bd2b2).

Files with missing lines Patch % Lines
...riable-sensitivity/variable_sensitivity_domain.cpp 97.67% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8805   +/-   ##
========================================
  Coverage    80.01%   80.01%           
========================================
  Files         1700     1700           
  Lines       188345   188381   +36     
  Branches        73       73           
========================================
+ Hits        150696   150731   +35     
- Misses       37649    37650    +1     

☔ View full report in Codecov by Sentry.
📢 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.

@tautschnig tautschnig force-pushed the fix-6272-three-way-merge-field-sensitive branch from 459076c to a4f1655 Compare December 9, 2025 14:38
@tautschnig tautschnig marked this pull request as ready for review December 9, 2025 14:39
Copilot AI review requested due to automatic review settings March 10, 2026 13:35
@tautschnig tautschnig force-pushed the fix-6272-three-way-merge-field-sensitive branch from a4f1655 to cb267f9 Compare March 10, 2026 13:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves three-way merge behavior under --vsd-structs every-field by making merges field-sensitive for structs and recursively descending into nested struct fields, while conservatively treating arrays as wholly modified.

Changes:

  • Added recursive path collection to identify leaf-level modified fields within structs (and conservative handling for arrays).
  • Updated three-way merge of function returns to assign only modified sub-paths rather than entire symbols.
  • Added a regression test covering field-sensitive merges for struct fields.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/analyses/variable-sensitivity/variable_sensitivity_domain.cpp Adds recursive modified-path discovery and uses it to selectively assign modified fields during three-way merge.
regression/goto-analyzer/variable-sensitivity-assign-aware-merge-struct-02/test.desc Adds a regression driver for --three-way-merge with --vsd-structs every-field.
regression/goto-analyzer/variable-sensitivity-assign-aware-merge-struct-02/main.c Adds a C test exercising field-level preservation across merges.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

For structs with struct-typed fields, merging now recursively descends
to identify leaf-level modifications.  Array handling uses a
conservative approach (marking entire array as modified) since
enumerating all indices is not practical.

Co-authored-by: Kiro autonomous agent

Fixes: diffblue#6272
Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
@tautschnig tautschnig force-pushed the fix-6272-three-way-merge-field-sensitive branch from cb267f9 to f8bd2b2 Compare March 10, 2026 19:10
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.

goto-analyzer --three-way-merge is not field sensitive

3 participants