Skip to content

Split at leaf program points other than numbered exits - #858

Closed
mernst wants to merge 8 commits into
codespecs:masterfrom
mernst:dataflow-leaf
Closed

mernst wants to merge 8 commits into
codespecs:masterfrom
mernst:dataflow-leaf

Conversation

@mernst

@mernst mernst commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

PptRelation assumed that numbered exits are the only leaves of the dataflow hierarchy. At any other leaf with splitters (such as a :::POINT program point, as produced by convertcsv.pl), the samples went only to the conditional program points, so the program point had no samples and no implications.

The new PptTopLevel.is_dataflow_leaf() is the single definition of a leaf. PptRelation, FileIO.process_sample, MergeInvariants, and setupEquality all use it. To make the ppt-type predicates (is_subexit, is_combined_exit, is_dataflow_leaf, ...) agree, PptTopLevel derives each program point's type from its name when the declaration does not give one, and normalizes inconsistent declared types (for example, a numbered exit declared with ppt-type exit is a subexit).

Other changes:

  • PptRelation: init_hierarchy (old declaration format) and init_hierarchy_new share the code that connects conditional program points and finishes the hierarchy.
  • Non-leaf program points with no children, such as :::GLOBAL and a combined exit with no numbered exits, get equality views rather than failing an assertion.
  • MergeInvariants builds the hierarchy from a decls file the same way Daikon does.
  • AnnotateNullable handles an .inv file that has numbered exits but no combined exit.

Test changes:

  • The new SplitPoint test splits a :::POINT program point.
  • In the KnownValues and KnownValuesNewDecls goal files, invariants are reported at :::EXIT rather than :::EXIT1: their numbered exits are declared with ppt-type exit, which is now normalized to a subexit, so Daikon creates the combined exit.

runcluster.pl (#856) depends on this change; its tests are in tests/script-tests/runcluster/.

Daikon treats arbitrarily named program points such as :::POINT (used by
convertcsv.pl) as leaves of the dataflow hierarchy, but the splitter
hierarchy code treated only numbered exit points as leaves.  As a result,
splitting at such a program point produced no samples and no implications.

Add PptTopLevel.is_dataflow_leaf() and use it consistently.
@mernst mernst mentioned this pull request Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: codespecs/daikon/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6091d803-02d6-48b3-ad3f-037b8576fb26
📥 Commits

Reviewing files that changed from the base of the PR and between b7136ac and 0e7db0a.

⛔ Files ignored due to path filters (1)
  • tests/daikon-tests/SplitPoint/SplitPoint.dtrace.gz is excluded by !**/*.gz
📒 Files selected for processing (16)
  • java/daikon/AnnotateNullable.java
  • java/daikon/Daikon.java
  • java/daikon/FileIO.java
  • java/daikon/MergeInvariants.java
  • java/daikon/PptConditional.java
  • java/daikon/PptName.java
  • java/daikon/PptRelation.java
  • java/daikon/PptTopLevel.java
  • tests/daikon-tests/KnownValues/KnownValues.txt-daikon.goal
  • tests/daikon-tests/KnownValuesNewDecls/KnownValuesNewDecls.txt-daikon.goal
  • tests/daikon-tests/Makefile
  • tests/daikon-tests/NonZeroLargeRange/NonZeroLargeRange.txt-daikon.goal
  • tests/daikon-tests/SplitPoint/Makefile
  • tests/daikon-tests/SplitPoint/SplitPoint.decls
  • tests/daikon-tests/SplitPoint/SplitPoint.spinfo
  • tests/daikon-tests/SplitPoint/SplitPoint.txt-daikon.goal

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Program-point types are normalized from names, and dataflow-leaf checks now guide hierarchy construction, sample processing, and invariant merging. Nullable annotation discovery and evaluation can use numbered exits when a combined exit is absent. Test expectations update exit labels, and a SplitPoint test fixture is added.

Suggested reviewers: markro49

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 0e7db

No actionable issue is established from the available evidence; the change is mergeable after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 0e7db

The examined changes remain within file-based analysis and do not establish new privileges or output destinations. The shared classification change has a meaningful compatibility surface, with historical serialized inputs and interrupted or concurrent use only partially assessed.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated exposure is caller-selected analysis inputs and derived annotation or invariant results. The examined changes do not establish a new tenant, service, credential, or privileged execution boundary.

Trust Boundaries and Controls

  • observed — Annotation generation remains a serialized invariant-file-to-stdout pipeline. The new method-exit selection changes which local analysis nodes contribute; it does not grant authority or select an additional output destination. File loading and stdout emission predate this PR.

Resilience and Maintainability Implications

  • observed — Recursive merging guards already-completed nodes and marks both empty-sample and normal completion states. Template preparation resets merge flags and counters. The inspected merge entrypoint propagates setup or merge failures before its final output step; these mechanisms do not establish transactional recovery or concurrent-use safety.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 8 files. (8 skipped: 8 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

mernst added 7 commits October 5, 2026 21:20
FileIO.process_sample and MergeInvariants now use is_dataflow_leaf() rather
than their own leaf tests.  is_dataflow_leaf() follows the declared ppt type
when there is one, treats :::GLOBAL as a non-leaf, and is the basis of the
final assertion in init_hierarchy_new.

The new SplitPoint test splits a :::POINT program point.
… SplitPoint test

* FileIO reads a "ppt-type exit" declaration of a numbered exit (such as
  foo:::EXIT22) as SUBEXIT, so is_subexit, is_combined_exit, and
  is_dataflow_leaf agree about it.  is_dataflow_leaf no longer special-cases it.
* process_sample again rejects samples at any combined-exit name.
* init_hierarchy (old decls) also creates equality views for childless
  non-leaves such as :::GLOBAL; the assertion there excludes combined exits.
* MergeInvariants builds the hierarchy from a decls file the same way Daikon does.
* SplitPoint test data now yields implications relating x and y.
…e hierarchy dispatch

Normalize a numbered exit typed EXIT or POINT to SUBEXIT, and a non-combined-exit
name typed EXIT to POINT, in the PptTopLevel constructor and readObject, so that
deserialized ppts also get consistent predicates.  Remove MergeInvariants's
assertion that non-leaves have children, allow childless combined exits, and drop
splitters of childless non-leaves.  Add PptRelation.init_hierarchy_for_decl_format.
…e normalization, merge-link cleanup, AnnotateNullable, shared helpers

- MergeInvariants: set up equality views on childless non-leaves when the
  merge template comes from .inv files; remove only MERGE_CHILD relations
  in the final cleanup.
- PptTopLevel.normalize_type: require EXIT followed by digits for SUBEXIT;
  a POINT- or EXIT-typed foo:::EXIT is a combined exit.
- Daikon.create_combined_exits: do not replace a declared combined exit.
- AnnotateNullable: accept a numbered exit with no combined-exit parent as
  a method's exit.
- Share conditional-connection and hierarchy-finishing code between
  init_hierarchy and init_hierarchy_new; share equality-view creation.
… combined exits

* PptTopLevel.normalize_type also derives ENTER, OBJECT, and CLASS from the
  name, and applies to ppts with no declared type, so the is_* predicates no
  longer need name-based fallbacks.  PptConditional takes its parent's type.
* Move the numbered-exit name test to PptName.isExitWithLineNumber.
* AnnotateNullable processes a method once even when an .inv file lacks its
  combined exit, combining the annotations of all its numbered exits.
* Reword the FileIO comment about samples at combined exit points.
* init_hierarchy_new again includes conditional relations in its debug output.
# Conflicts:
#	tests/daikon-tests/Makefile
mernst added a commit to mernst/daikon that referenced this pull request Oct 6, 2026
Use issue537's runcluster scripts, which support the new declaration format
and declarations in dtrace files, and which fix invocation nonces in a
temporary copy of the trace.  Retain issue365's check that each dtrace
record matches its declaration, now for both declaration formats.

Omit issue537's Daikon changes for leaf program points, which codespecs#858 does
more completely, and its Issue537 tests, which duplicate codespecs#858's SplitPoint
test.
@mernst
mernst changed the base branch from master to share-hierarchy-code October 6, 2026 15:32
@mernst
mernst changed the base branch from share-hierarchy-code to master October 6, 2026 15:32
@mernst

mernst commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Replaced by a stack of three smaller PRs: #871 (derive ppt types from names), #872 (share hierarchy code), and #873 (the leaf fix itself).

@mernst mernst closed this Oct 6, 2026
mernst added a commit to mernst/daikon that referenced this pull request Oct 6, 2026
PptRelation.init_hierarchy (old declaration format) and init_hierarchy_new
now share connect_conditionals and finish_hierarchy, so the old format also
creates equality views for childless non-leaves.  A non-leaf with no
children has its splitters removed.  New methods
PptRelation.init_hierarchy_for_decl_format and
PptTopLevel.create_equality_view replace duplicated code.

Split from codespecs#858.
mernst added a commit to mernst/daikon that referenced this pull request Oct 6, 2026
PptRelation.init_hierarchy (old declaration format) and init_hierarchy_new
now share connect_conditionals and finish_hierarchy, so the old format also
creates equality views for childless non-leaves.  A non-leaf with no
children has its splitters removed.  New methods
PptRelation.init_hierarchy_for_decl_format and
PptTopLevel.create_equality_view replace duplicated code.

Split from codespecs#858.
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.

1 participant