This issue is part of a Codex global repository scan.
Problem:
LMDBDataset.__init__ counts entries per matched LMDB path, but records only the logical file and local index. get() recomputes all matching LMDB paths for that file and loops through all of them, overwriting the loaded sample each time.
Code references:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/data/dataset/lmdb_dataset.py#L69-L77
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/data/dataset/lmdb_dataset.py#L138-L144
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/data/dataset/lmdb_dataset.py#L180-L187
Impact:
For wildcard or multi-root datasets where the same LMDB folder name appears under multiple roots, samples from earlier databases can be read from the last matching LMDB instead. This corrupts dataset indexing and can mix labels/geometries from the wrong source.
Suggested fix:
Record the resolved LMDB path alongside each global sample index, and have get() open exactly that path instead of recomputing all matches.
This issue is part of a Codex global repository scan.
Problem:
LMDBDataset.__init__counts entries per matched LMDB path, but records only the logicalfileand local index.get()recomputes all matching LMDB paths for that file and loops through all of them, overwriting the loaded sample each time.Code references:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/data/dataset/lmdb_dataset.py#L69-L77
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/data/dataset/lmdb_dataset.py#L138-L144
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/data/dataset/lmdb_dataset.py#L180-L187
Impact:
For wildcard or multi-root datasets where the same LMDB folder name appears under multiple roots, samples from earlier databases can be read from the last matching LMDB instead. This corrupts dataset indexing and can mix labels/geometries from the wrong source.
Suggested fix:
Record the resolved LMDB path alongside each global sample index, and have
get()open exactly that path instead of recomputing all matches.