Skip to content

Add mechanism diagnostics infrastructure#49

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
cl/936617333
Open

Add mechanism diagnostics infrastructure#49
copybara-service[bot] wants to merge 1 commit into
mainfrom
cl/936617333

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jun 23, 2026

Copy link
Copy Markdown

Add mechanism diagnostics infrastructure

Add MechanismDiagnostics dataclass, timed() context manager, and
clique_stats() helper to common.py. Wire diagnostics into all six
discrete mechanisms (AIM, AIM-GDP, Direct, Independent, MST, SWIFT).

Each mechanism now reports:

  • Per-phase wall-clock timing (selection, measurement, estimation)
  • Structural stats: clique count/sizes, junction tree node sizes
  • Round count for iterative mechanisms (AIM, AIM-GDP)

clique_stats() takes the fitted MarkovRandomField directly, extracting
cliques and domain from the model's potentials.

In AIM and AIM-GDP, replaces manual t0/t1/t2/t3 timing with the
timed() context manager. In MST, replaces the inline
hypothetical_model_size call with the richer clique_stats helper.

@copybara-service copybara-service Bot force-pushed the cl/936617333 branch 2 times, most recently from 2907142 to 86b8f9d Compare June 23, 2026 13:36
Add MechanismDiagnostics dataclass, timed() context manager, and
clique_stats() helper to common.py.  Wire diagnostics into all six
discrete mechanisms (AIM, AIM-GDP, Direct, Independent, MST, SWIFT).

Each mechanism now reports:
- Per-phase wall-clock timing (selection, measurement, estimation)
- Structural stats: clique count/sizes, junction tree node sizes
- Round count for iterative mechanisms (AIM, AIM-GDP)

clique_stats() takes the fitted MarkovRandomField directly, extracting
cliques and domain from the model's potentials.

In AIM and AIM-GDP, replaces manual t0/t1/t2/t3 timing with the
timed() context manager.  In MST, replaces the inline
hypothetical_model_size call with the richer clique_stats helper.

PiperOrigin-RevId: 936617333
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.

0 participants