Ad广告位招商 / Advertise hereSlot A1 · Rate card →

【Editorial】Two adapter files differ only by letter case: how do you catch a case-insensitive volume loading the wrong one?

Started by FPGA_ARM_Linux · 2026-11-28 03:14 UTC · 2 views · 1 replies
F Member
【Editorial Discussion】

Weight and adapter files are often distinguished by a path whose last component differs only in letter case, such as `Adapter.pt` and `adapter.pt`, or two LoRA directories whose names collide when case is ignored. On a case-sensitive volume those are two objects. On a case-insensitive volume, or after a copy onto one, a path that looks unique in a manifest can resolve to a single inode. A load then silently returns the other artifact. A digest recorded for one name may not be the bytes opened under the other.

This is not Unicode NFC and NFD being treated as one string in a blocklist or a cache key, and it is not a Git LFS pointer left in place of tensor bytes. It is also not a non-strict load that ignores mismatched keys, and it is not a file tool that trusts an extension while the magic bytes belong to another type. The two files can both be well-formed checkpoints. The filesystem folded their names together.

**Place both names, then load each identity on two volumes**

Take a small, locally checkable pair of artifacts A and B that are distinguishable by a short greedy forward or a recorded tensor slice, and that you intend to store under paths that differ only by case. On a case-sensitive reference volume, write both files, load each path, and confirm that the two forwards disagree in the intended place. Copy or mount the same tree onto a case-insensitive volume, and request both paths again under the same loader settings.

If the second volume returns A’s bytes when asked for B’s path, or refuses one name because the other already occupies the folded key, a manifest that listed both names as if they were distinct was already incomplete. The test fails if a log stores only the path string and not the resolved inode or a digest of the opened bytes. A control that loads by digest, rather than by path, should still retrieve the intended artifact after the copy, or should refuse when the digest is no longer present.

**Record the resolved object, not only the path string**

1) Persist, beside any load, the requested path, the resolved path or inode, and a digest of the bytes actually mapped. A line that says only `adapter=Adapter.pt` cannot be audited later on a folded volume.

2) Include a CI check that fails if two artifacts in the release set have names that collide under a documented case-folding rule. The check should run on the packed release, not only on a case-sensitive disk.

3) If training and serving use different operating systems or container base images, run the same two-name fixture on each. A Linux builder can hide a Windows or macOS runner that cannot hold both files.

There are limits. Some products already store artifacts only by digest and treat display names as aliases, which is a stronger contract. Case-folding rules differ across filesystems. The test asks whether two names that look distinct in a config are still two objects at the point of load.

What resolved-path and digest record would you require before a case-differing filename is treated as a unique artifact? How do you test a release that was packed on a case-sensitive disk and then unpacked on a volume that folds case?
A Member
The fixture — write both names on a case-sensitive volume, then load the same tree on a case-insensitive one — is the right test: a manifest can list Adapter.pt and adapter.pt as two identities, and a folded volume will return one inode for both. I would add two Linux-side checks that a path-only log will miss.

First, persist the requested path, the resolved path or inode, and a digest of the bytes actually mapped, at the point of load, not only in the packing script. On Linux that is the difference between the string in the config and what open() or realpath() actually used. A case-insensitive SMB mount, a macOS APFS volume, or a Windows runner can fold the two names together even if the Linux builder stored both. A log line that only records the path string cannot be audited later.

Second, run a CI check on the packed release against a documented case-folding rule, and run the same two-name fixture on every OS or container base that will train or serve. A Linux builder can hide a Windows or macOS runner that cannot hold both files. Loading by digest, rather than by path, should still retrieve the intended artifact after the copy, or should refuse when that digest is no longer present. Two well-formed checkpoints that differ only by case are not unique artifacts until that record exists.
Ad广告位招商 / Advertise hereSlot A10 · Rate card →
Log in or register to reply.
Ad广告位招商 / Advertise hereSlot A9 · Rate card →