← Documentation
ADS-IDAC Engine 5.0.0
ConfigFingerprint.h File Reference

FNV-1a digest of the immutable configuration inputs. More...

#include <algorithm>
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <string>
#include <vector>
Include dependency graph for ConfigFingerprint.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  adsidac
 

Functions

void adsidac::fingerprint_feed (uint64_t &h, const char *data, size_t n)
 Fold n bytes at data into the running 64-bit FNV-1a hash h (xor the byte, then multiply by the FNV prime 1099511628211). More...
 
void adsidac::fingerprint_feed_file (uint64_t &h, const std::filesystem::path &p)
 Fold the contents of file p into h, read in 64 KiB blocks. A file that cannot be opened contributes nothing and is not reported. More...
 
uint64_t adsidac::compute_config_fingerprint (const std::string &project_dir, const std::string &deck_path)
 Digest the configuration inputs of a project. More...
 

Detailed Description

FNV-1a digest of the immutable configuration inputs.

Checkpoints do not embed configuration: snapshots are state-only, and a resume reconstructs config from the project directory's files. That is only sound if those files are the ones the checkpoint was written against, so every run digests them at startup (Scheduler::initiationForSimulation, printed as "[CONFIG] fingerprint=0x..."), every checkpoint stores the digest, and a resume refuses on mismatch.

The file set is an ALLOWLIST, never a directory sweep: runs drop debris (out.o, err messages.txt, Output/, rank_*) into the project directory and a sweep would false-positive on it. Hashed: the input deck, every regular file under Input/, and ZCtrlPar.txt, each as its project-relative path plus contents, in sorted path order. Deliberately excluded: ZiniADS.txt (holds machine-specific absolute paths; would break resuming an identical project on another machine), steam tables (live beside the binary, not in the project), and all runtime artifacts. CLI options such as –truncation-time are outside the digest, so a resume must repeat them. FNV-1a detects accidental edits, not adversaries.

Definition in file ConfigFingerprint.h.