Skip to content

Make LCM capture deterministic and add shorten file names#5203

Merged
sisuresh merged 6 commits intostellar:masterfrom
sisuresh:test-lcm
Apr 6, 2026
Merged

Make LCM capture deterministic and add shorten file names#5203
sisuresh merged 6 commits intostellar:masterfrom
sisuresh:test-lcm

Conversation

@sisuresh
Copy link
Copy Markdown
Contributor

@sisuresh sisuresh commented Apr 2, 2026

Summary

  • Zero non-deterministic diagnostic timing events (invoke_time_nsecs) in captured LCM files so output is stable across runs
  • Skip rewriting LCM files when regenerated content is semantically equal to existing files (using normalized comparison), avoiding noisy diffs from unordered map iteration order
  • Shorten file names

sisuresh added 2 commits April 2, 2026 15:25
The invoke_time_nsecs core_metrics diagnostic event contains
wall-clock timing data that varies between runs. Zero these values
when writing LCM files from tests so that regenerated output is
deterministic and comparable across machines.
Copilot AI review requested due to automatic review settings April 2, 2026 22:42
Copy link
Copy Markdown
Contributor

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

This PR aims to make auto-captured LedgerCloseMeta (LCM) output deterministic and enforce that determinism in CI so checked-in capture files stay stable and up to date.

Changes:

  • Zeroes non-deterministic diagnostic timing events (e.g., invoke_time_nsecs) when capturing LCM.
  • Skips rewriting LCM files when regenerated output is semantically equivalent (after normalization).
  • Adds a CI step that runs --capture-lcm and fails if test-lcm/ changes.

Reviewed changes

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

File Description
src/util/MetaUtils.h Declares helper to zero non-deterministic diagnostic fields in LCM.
src/util/MetaUtils.cpp Implements diagnostic-event detection and zeroing across LCM versions.
src/test/test.cpp Adds semantic comparison to skip rewrites and applies diagnostic-zeroing on output.
ci-build.sh Adds CI job step to regenerate LCM and fail when test-lcm/ differs.

@sisuresh sisuresh marked this pull request as draft April 3, 2026 18:26
@sisuresh sisuresh marked this pull request as ready for review April 3, 2026 19:06
@sisuresh sisuresh enabled auto-merge April 4, 2026 00:10
@sisuresh sisuresh changed the title Make LCM capture deterministic and add CI check Make LCM capture deterministic and add shorten file names Apr 4, 2026
@sisuresh sisuresh added this pull request to the merge queue Apr 6, 2026
Merged via the queue into stellar:master with commit fb04583 Apr 6, 2026
54 checks passed
@sisuresh sisuresh deleted the test-lcm branch April 6, 2026 19:38
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.

3 participants