GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Build each class's state machine once per checker by CatarinaGamboa · Pull Request #414 · liquid-java/liquidjava

Conversation

@CatarinaGamboa

@CatarinaGamboa CatarinaGamboa commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Stacked on #413.

Description

Building a state machine takes about 25 SMT checks for a small class, and each check creates its own Z3 context. The machine only depends on specifications, which are all registered in the first pass, so TypeChecker now builds it on the first state error and reuses it for every later error in the same checker. Finding the receiver's current states still runs at each error.

Other options considered:

  • Eagerly, after the first pass, for every class with @StateSet: correct programs would pay the SMT cost too. Only worth it once something needs machines without an error, e.g. the fsm diagram.
  • Once per run, cached in Context: Context would depend on state_machine, which depends on context (a package cycle). The other way is a static cache that tracks when specifications change. Neither seemed worth it for the extra hits across classes.

Cost

Extra time of TestExamples on the 269 cases that exist on main (summed per case, one run each; main takes 80.3 s):

  • List the calls that reach an allowed state when the state is unknown #413, without the cache: +29.5 s
  • with this PR: +10.6 s, spread over the 54 files with state errors

Type of change

  • Code refactoring

Checklist

  • mvn test passes locally

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@CatarinaGamboa
CatarinaGamboa added this pull request to stack #415 October 23, 2026 16:59
@CatarinaGamboa @claude
Build each class's state machine once per checker
1041d9d
The state machine only depends on specifications, which are all known
before a checker starts, so it is built on the first state error in a
class and reused for the next ones.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@CatarinaGamboa
CatarinaGamboa force-pushed the feat/state-hints-unknown branch from 3af49f3 to d1785aa Compare October 23, 2026 17:45
@CatarinaGamboa
CatarinaGamboa force-pushed the feat/state-machine-cache branch from 1bb9204 to 1041d9d Compare October 23, 2026 17:45
@CatarinaGamboa
CatarinaGamboa removed this pull request from stack #415 October 23, 2026 18:02
@CatarinaGamboa
CatarinaGamboa merged commit a1a7b8d into feat/state-hints-unknown Oct 24, 2026
@CatarinaGamboa CatarinaGamboa mentioned this pull request Oct 24, 2026
Land the rest of the state hints stack (#412, #413, #414) #417
Merged
1 task done
CatarinaGamboa added a commit that referenced this pull request Oct 24, 2026
@CatarinaGamboa @claude
Land the rest of the state hints stack (#412, #413, #414) (#417)
69895fa
## Description
#412, #413 and #414 were merged into their stacked base branches instead
of `main`: once #411 was merged, their bases were never retargeted.
Their code is only on `feat/state-hints-unknown`.

This PR applies the three reviewed commits on top of `main`, unchanged:
- Explain dead ends in failing state transitions (#412)
- List the calls that reach an allowed state when the state is unknown
(#413)
- Build each class's state machine once per checker (#414)

The hint and state machine files are identical to
`feat/state-hints-unknown`. Rebase-merging keeps the three commits
separate.

## Checklist
- [x] `mvn test` passes locally on top of the current `main` (#408,
#409)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@CatarinaGamboa
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.