﻿# Verify model artifacts with the checksum actually supplied

Match the supplied checksum algorithm, representation and full/composite scope to the downloaded bytes; do not assume every S3 ETag is a file digest.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/guide-storage-object-checksum/
Language: en

A downloaded checkpoint fails a local digest comparison even though S3 reports a checksum. First establish what checksum was supplied. Algorithm, encoding and full-object versus composite scope belong to the integrity contract. Comparing two differently constructed values does not prove corruption, while accepting any matching-looking metadata string does not prove the intended artifact was received.

## Preserve checksum identity

Record the object identity, checksum field name, algorithm and returned representation. A hexadecimal local digest and an encoded service field can describe the same algorithm without sharing a printable representation. Decode and compare under the documented contract rather than trimming characters until strings match. Retain the original metadata so later parser changes can be audited without obtaining a different current object.

## Distinguish full and composite scope

Amazon S3 documents full-object checksums and composite checksums formed from part-level values. Their constructions differ. A whole-file hash calculated locally cannot simply be compared to a composite value because both labels contain the same algorithm name. Preserve the checksum type and applicable part context when the workflow uses multipart storage, and verify support for the selected algorithm and type combination.

## Avoid universal ETag assumptions

An entity tag has object-identity and conditional-request uses, but is not universally a whole-object MD5 digest. Multipart construction and other documented object conditions matter. Do not infer verification success from a plausible entity-tag length or suffix. The integrity check must use a supported checksum contract or a separately trusted release digest tied to the accepted immutable model revision.

## Verify the bytes actually consumed

Complete the intended download and handle errors before reporting validation. If the loader reads only a range, distinguish the range's bytes from a full-object checksum scope. The service's returned metadata and SDK behavior need explicit interpretation; do not assume every SDK or compatible endpoint automatically performs the same validation. Preserve any missing checksum or unsupported verification outcome as unknown, rather than converting it to success.

## Keep integrity separate from trust

Use the accepted digest source to validate the actual local artifact before publication, then perform normal format and package-consistency checks. Test encoding and checksum-type mismatches with synthetic fixtures. A useful result separates true content mismatch from incompatible comparison rules. It does not establish who authorized the model, prove safe repository code or certify semantic correctness merely because transport integrity matched.

## Primary references

[Amazon S3 Full and Composite Checksums](https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity-upload.html).

[Amazon S3 GetObject State and Version Semantics](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html).

[Amazon S3 HeadObject Metadata and Error Scope](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html).

Related reading: [Validate safetensors weight artifacts separately from repository code](/journal/safetensors-artifact-validation/); [The digest matches, but whom do you trust: verifying container image signatures](/journal/artifact-signature-verification/).
