Skip to content

core/io: fix H5MD time/step datasets off-by-one vs value datasets#5342

Draft
RudolfWeeber wants to merge 3 commits into
espressomd:pythonfrom
RudolfWeeber:fix/core-01-h5md-time-offset
Draft

core/io: fix H5MD time/step datasets off-by-one vs value datasets#5342
RudolfWeeber wants to merge 3 commits into
espressomd:pythonfrom
RudolfWeeber:fix/core-01-h5md-time-offset

Conversation

@RudolfWeeber

Copy link
Copy Markdown
Contributor

create_dims() for rank-1 datasets (step/time) returned an initial shape
of {data_dim} (non-zero), while rank-2/3 value datasets started at {0,...}.
As a result id/step and id/time were seeded with one fill element at index 0,
and every subsequent write landed at offset extents[0] of the value dataset,
misaligning the time axis by one frame for the entire trajectory.

Fix: return {0ul} for rank-1 in create_dims(), matching the value
datasets (src/core/io/writer/h5md_core.cpp).

Regression test: test_time_step_alignment added to H5mdTests in
testsuite/python/h5md.py.

Fixes bug #1 of the adversarial core bug sweep.

…tial extent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@RudolfWeeber

Copy link
Copy Markdown
Contributor Author

@hidekb what's your take on this?

@hidekb

hidekb commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This suggestion is essentially correct. However, this modification causes an error in the test hdmd.py. I try to fix it.

@hidekb hidekb self-assigned this Jun 16, 2026
@RudolfWeeber RudolfWeeber added this to the ESPResSo 5.0.2 milestone Jul 23, 2026
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.

2 participants