Tutorials › Pharmacometric Workflows and Reproducible Modeling › Auditing Reproducibility From a Clean Checkout

Project Structure, Version Control and Documentation · Tutorial 62 of 399

Auditing Reproducibility From a Clean Checkout

Use an independent clean-checkout audit to determine whether a project’s documented workflow can recreate its expected outputs without relying on undocumented local files.

Intermediate 11 min read

What You'll Learn

  • Define the revision, starting conditions, inputs, and expected outputs for a reproducibility audit.
  • Separate setup and execution checks from comparisons of generated outputs.
  • Choose exact or tolerance-based output checks appropriate to the workflow.
  • Record evidence that distinguishes a clean-checkout result from a run dependent on local state.
  • Interpret what a successful audit does and does not establish.

Why Audit From a Clean Checkout?

A project may run successfully on its author’s computer because that computer contains more than the repository: cached data, manually installed packages, environment variables, edited configuration files, or outputs left by an earlier run. A successful run in that workspace therefore does not by itself show that the documented project can be reproduced by another analyst.

A clean-checkout audit tests a more specific claim: starting from a stated version of the repository and the documented, permitted inputs, can a colleague set up the required environment, execute the documented workflow, and obtain the expected outputs without relying on undeclared local state? This is a practical test of the handoff, not merely an inspection of files or a review of code.

Definition: A clean-checkout reproducibility audit is an independent execution of a project from a fresh checkout of a specified repository revision, using only its documented setup, declared inputs, and permitted external resources. The audit records whether the workflow completes and whether its outputs meet prespecified comparison criteria.

The audit is strongest when the person performing it did not prepare the project and begins in a new directory or isolated environment. The revision must be identifiable, for example by a commit identifier, and the expected outputs and their comparison rules must be specified before inspecting the new run. Otherwise, an analyst can unconsciously adjust the criteria to fit whatever happened.

Specify the Audit Before Running It

A reproducibility claim is meaningful only when its scope is clear. Record the repository location and exact revision; the operating system or execution environment; the setup instructions to be followed; the required inputs and where they may be obtained; the documented entry point and execution order; and the outputs that will be checked. For a pharmacometric project, expected outputs might include a model-run summary, parameter estimates, diagnostic tables, or figures. A clean audit need not redistribute confidential patient-level data: it must state which authorized inputs are required and confirm that the auditor can access them under the project’s procedures.

Also decide what “same output” means. Some outputs should match exactly, such as a configuration file or a table of fixed labels. Numerical results may need a defined tolerance because software versions, hardware, parallel computation, or numerical libraries can cause small differences. A tolerance is not a license to overlook material changes: it should reflect the intended reproducibility claim and the scale and units of the quantity being compared.

Audit criterion: For a checked numerical output, let \(y_{\mathrm{ref}}\) be the prespecified reference value and \(y_{\mathrm{new}}\) the value from the clean run. A common comparison rule is \[ \left|y_{\mathrm{new}}-y_{\mathrm{ref}}\right| \leq \mathrm{atol}+\mathrm{rtol}\left|y_{\mathrm{ref}}\right|, \] where \(\mathrm{atol}\) is an absolute tolerance and \(\mathrm{rtol}\) is a relative tolerance, both stated before the comparison. Exact-match checks instead require equality under an explicitly stated representation, such as identical file contents or identical values after a specified rounding rule.

The audit assumes that the chosen revision and reference outputs are authentic, the required inputs are appropriate and available, and the comparison rule is suitable for the output. It also assumes that the auditor follows the documented procedure rather than adding undocumented fixes. If any of these conditions is not met, report the limitation rather than treating a partial or altered run as a successful reproduction.

A Controlled Audit Sequence

Keep the stages distinct so that a failure can be localized. Record the initial state before installation or execution; in particular, note the revision and whether the checkout is clean. Follow the written setup instructions as a colleague would. Do not silently install extra packages, copy in local configuration, or edit scripts to get a run through. If a necessary step is missing, record it as an audit finding.

1
Fix the target.
Identify the repository, revision, authorized inputs, expected outputs, and comparison rules before starting.
2
Create the clean starting point.
Clone or check out the specified revision into a new location. Record the revision identifier and verify that no uncommitted changes or prior generated outputs are present.
3
Follow documented setup.
Use the stated environment and setup steps. Record required software, package installation, input access, and any deviations or undocumented requirements.
4
Execute the stated workflow.
Run the documented entry point and sequence, using the stated configuration. Preserve logs, exit status, and the names and locations of generated outputs.
5
Compare and report.
Apply the prespecified exact-match or tolerance criteria. Report completion, discrepancies, and limitations separately; do not label a failed or modified run as a pass.

The logic behind a fresh starting point is straightforward. Let the run result depend on both repository contents \(R\) and local state \(L\): \(Y=f(R,L)\). A run on the author’s computer observes \(f(R,L_{\mathrm{author}})\), so it cannot establish that repository contents alone, together with the declared inputs and environment, are sufficient. A clean checkout removes many undeclared components of \(L_{\mathrm{author}}\). If the colleague can then follow the documented steps and meet the prespecified output criteria, that is evidence for the narrower and useful claim that the stated handoff is executable under the audited conditions. It does not prove that every machine or future software environment will behave identically.

Worked Example: Checking the Revision and Setup Instructions

Suppose a colleague audits a hypothetical oral-drug population-model project at the recorded revision 8f31c2. The README says to create the pinned software environment, place the authorized analysis data in a named input location, and run the project’s stated entry point. The expected outputs are a run summary and a parameter table.

The colleague checks out revision 8f31c2 into a new directory and records that the checkout has no local modifications. The instructions specify the environment file and name the required input, but they do not say how to obtain that input or where to place it. The colleague therefore stops before execution rather than copying a similarly named file from a personal directory.

Audit result. The revision checkout and documented environment setup are verifiable, but the end-to-end audit is incomplete because a necessary input-access and placement step is unspecified. This is not evidence that the model code gives incorrect results; it is evidence that a colleague cannot yet execute the full documented workflow from the stated starting conditions. The finding should identify the missing instruction, without inventing one and calling the original procedure reproducible.

Check Outputs Against a Prespecified Rule

A workflow that exits without an error has not necessarily recreated the intended analysis. It may have produced an empty table, used the wrong configuration, or written outputs to an unexpected location. Check that the expected files exist, that their contents are meaningful, and that the relevant values meet the specified criteria. Comparing only filenames or only a successful exit status is insufficient.

Worked Example: Applying Numerical Tolerances

A hypothetical reference run reports apparent clearance \(4.80\) L/h and central volume \(36.5\) L. Before the audit, the team sets \(\mathrm{atol}=0.05\) in the relevant parameter’s units and \(\mathrm{rtol}=0.001\). The clean run reports clearance \(4.82\) L/h and central volume \(36.7\) L. Apply the rule \(\left|y_{\mathrm{new}}-y_{\mathrm{ref}}\right| \leq \mathrm{atol}+\mathrm{rtol}\left|y_{\mathrm{ref}}\right|\).

Clearance. The observed difference is \(\left|4.82-4.80\right|=0.02\) L/h. Its allowed difference is \(0.05+0.001(4.80)=0.0548\) L/h. Since \(0.02 \leq 0.0548\), clearance meets the criterion.

Central volume. The observed difference is \(\left|36.7-36.5\right|=0.20\) L. Its allowed difference is \(0.05+0.001(36.5)=0.0865\) L. Since \(0.20 > 0.0865\), central volume does not meet the criterion.

The clean run therefore does not pass this two-parameter comparison, even though one estimate is within tolerance and both values look numerically close. The conclusion is limited to the specified comparison: it does not identify why the volume differs. The audit report should retain the units, reference values, new values, and tolerances so another reviewer can verify the decision.

Tolerance rules must be chosen with care. Rounding both values before comparison can conceal meaningful discrepancies; compare at the prespecified precision or using the explicit tolerance formula. A single overall pass/fail label can also obscure an important failure in one output, so report checks individually. If an output is stochastic, specify which summaries or properties are expected to agree and how variability will be handled. A fixed random seed may support repeatability in a given environment, but it does not guarantee identical results across all software or hardware.

Worked Example: Detecting Dependence on a Local File

A hypothetical project’s documented workflow produces a table of individual predictions. An analyst’s usual working copy runs successfully. To test independence from local state, a colleague checks out the stated revision into a new directory and follows the instructions exactly. The run stops because it attempts to read a configuration file from an absolute path under the original analyst’s home directory; that file is not present in the clean checkout.

Interpretation. The clean run has demonstrated a dependency not satisfied by the repository and its documented setup. A successful run in the analyst’s existing workspace cannot resolve that finding, because the existing workspace contains the missing local file. The audit should record the requested path, the point at which execution stopped, and whether the file is supposed to be supplied as an authorized external input or generated by an earlier documented step.

Boundary of the conclusion. The finding establishes that the tested instructions and starting conditions were insufficient. It does not establish that the predictions would differ if the file were supplied, nor does it identify which configuration is scientifically appropriate. Those questions require a documented dependency and a subsequent audit at the specified revision.

Diagnostics, Alternatives, and Limits

Useful audit evidence includes the revision identifier, a record of the clean starting state, setup commands or steps followed, software-environment information, input identifiers or checksums where appropriate, execution logs, exit status, and an inventory of expected outputs and comparison results. Protect confidential material: provenance records should identify authorized inputs without exposing private data. If the workflow modifies tracked files, uses network resources, or relies on licensed software, record those facts and the conditions under which the run was performed.

Several patterns weaken the evidence. A run that starts from an old working directory can reuse generated files. An undocumented manual edit changes the tested procedure. A missing output may be overlooked when only the program’s exit status is checked. A tolerance chosen after seeing discrepancies is not an independent test. Each situation should be recorded as a limitation or deviation, not hidden behind a general statement that “the project ran.”

A code review can assess whether scripts and dependencies appear understandable, but it does not show that the documented steps work in a fresh environment. Re-running the workflow in the developer’s current workspace is faster, but it does not adequately test dependence on that workspace. A clean run in an isolated environment, including a container or managed continuous-integration system, can strengthen control over software and starting state; it still needs declared inputs, meaningful output checks, and a recorded revision. These approaches complement rather than replace an independent clean-checkout audit.

A pass is bounded evidence, not a universal guarantee. It applies to the revision, inputs, environment, and criteria actually tested. It does not establish that the model is scientifically valid, that every parameter estimate is correct, or that future revisions will reproduce the same outputs. A reproducible computational result can still be based on an inappropriate analysis choice. Conversely, small numerical differences can arise without changing the scientific interpretation, but the audit should not decide that after the fact: the acceptance rule must be explicit.

Key takeaway: A clean-checkout audit tests whether the documented project handoff is sufficient under stated conditions. Its credibility depends on an independent fresh start, a fixed revision, declared inputs and environment, documented execution, and output criteria chosen before the results are inspected.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A model run succeeds in a developer’s existing workspace, but no fresh checkout has been tested. What has and has not been established?
  2. A reference clearance is \(2.00\) L/h and the audited value is \(2.06\) L/h. If \(\mathrm{atol}=0.03\) L/h and \(\mathrm{rtol}=0.01\), does the value meet the stated comparison rule?
  3. Why should a numerical tolerance be set before examining the clean-run result?
  4. A fresh checkout completes successfully, but the expected parameter table is absent. Is the workflow a pass? Explain.
  5. Name two important items that should be recorded so another reviewer can assess the audit.

Solutions. (1) It establishes that the workflow ran in the developer’s current state; it does not show that another colleague can execute it from the repository and documented setup without local dependencies. (2) The difference is \(\left|2.06-2.00\right|=0.06\) L/h. The allowed difference is \(0.03+0.01(2.00)=0.05\) L/h, and \(0.06>0.05\), so it does not meet the rule. (3) Prespecification prevents choosing a permissive criterion in response to observed discrepancies and makes the comparison independently checkable. (4) No. Successful execution is not sufficient when a required expected output is missing; report the missing table and the workflow does not pass the stated output check. (5) Examples include the exact revision identifier, setup and execution record, software environment, authorized input identifiers, logs and exit status, or output comparisons with their criteria.

Clinical Biostats