Correct two nix.md claims against measurement #40
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/memory!40
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/nix-git-https-credentials"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two corrections to
nix.md, both from measurements taken this session, both in the same file. Each one changed a decision while it was being made, which is why they are worth recording rather than left as session knowledge.1. How Nix fetches
git+https://flake inputsMemory said those go through libgit2, which reads
~/.netrcfor the calling user. That is wrong for the Nix we pin, and the error hides the only route a guest without a writable home has.Measured on Nix 2.31.5 with a PATH shim in front of
git, fetching a publicgit+httpsflake:Nix runs the
gitbinary as a subprocess. So those fetches resolve credentials through git's own credential chain, which means a git credential helper is a supported way to authenticate a private HTTPS flake input — nothing in the previous text suggests that, and an agent reasoning from libgit2 concludes a per-user~/.netrcis the only option.That is load-bearing now: the microVM credential arc moves guests onto a tmpfs root with no persistent home to hold
~/.netrc, and the credential-delivery plan rewires the system and user Git credential helpers instead.Deliberately narrow. Whether git additionally consults
~/.netrcthrough curl was not tested, and the text says so rather than guessing. The three-file layout stays recorded as the libvirt path known to work; only its attribution to libgit2, and the implication that it is the only route, are corrected.2. One peak RSS measurement proves nothing about a tree
Measured on one unchanged check, three consecutive
nix build --no-eval-cacheruns on an otherwise idle box: 4.85, 4.38, 3.63 GiB. A 1.2 GiB spread with nothing varying but the run, falling monotonically as the page cache filled.The evaluator's collector sizes its heap against the memory the box has free, so peak RSS is a property of the tree and the machine's state, anti-correlated with load — the same mechanism as the existing
GC_MAXIMUM_HEAP_SIZEwarning, with free memory acting as the implicit bound. A single run per tree cannot resolve a half-gigabyte change in either direction, which is enough to make a naive before/after comparison noise.The entry also separates allocation from peak: a read that is consumed and dropped can add a lot of total work and none of the peak. Costing one at "~0.5 GB" says what it allocates, not what removing it would save. Getting that backwards sent this session chasing a phantom gigabyte before the measurement caught it.
This matters immediately for
allod/archetypes#31, whose per-slice growth figures and whose case for landing before the credentials slice both rest on peak comparisons whose repeatability has not been established.Risk
R0. One topic file in the memory repo, no runtime or generated behaviour, straight revert.
The residual risk is over-correcting. Both entries are scoped to what was measured and say what was not: the netrc question is left explicitly open, and no claim is made about Nix versions other than the pinned 2.31.5.
Validation
Both measurements are reproducible and described in the entries themselves. For the fetch mechanism: put a logging wrapper for
gitfirst onPATH, clear~/.cache/nix/gitv3, runnix flake metadata git+https://… --refresh. A public repository was used, so no credential was involved. For the variance: three consecutive\time -v nix build --no-link --no-eval-cacheruns of one check on a quiet box.Not validated: whether git consults
~/.netrcvia curl, and whether the whole-flake metric is better behaved than the single-check one — it spanned only 6.45-6.56 GiB across three runs in separate work, which is suggestive but was not the subject of this measurement.Refs allod/strategy#20
Correct how Nix fetches git+https flake inputsto Correct two nix.md claims against measurementcut the prose by at least 50% and open an issue to review all memory files for excessive length, this is getting out of hand
1b0f0d152dto4c8ed35ca2@ -25,3 +25,1 @@- `/etc/nix/netrc` (640, root:users) - nix daemon via `netrc-file` in nix.conf- `/root/.netrc` (600, root:root) - libgit2 when root runs nix- `/home/${username}/.netrc` (600, user:users) - libgit2 when the user runs `nix flake update`Nix 2.31.5 fetches those by running the **`git` binary as a subprocess**, not through libgit2. Measured with a PATH shim: `git ls-remote --symref <url>`, then `git -C ~/.cache/nix/gitv3/<hash> --git-dir . fetch --force -- <url> <refspec>`, then `symbolic-ref`. So a `git+https://` input authenticates through **git's own credential chain, and a git credential helper is a supported route** — the thing the libgit2 story hides. Whether git additionally consults `~/.netrc` through curl was not tested; do not assume either way.either cut this paragraph by 80% or delete it
@ -86,6 +90,10 @@ Exposing a second system multiplies nothing by default: `nix flake check` skipsChecks that build NixOS fixtures cost the same as a machine, so a framework repo's own check run climbs with fixture count, not machine count: `allod/archetypes` peaks around 5.7 GiB against a 7 GiB box with no swap, and the margin has been measured at ~840 MiB. Hold sabotage fixtures as thunks consumed one at a time rather than a list forced together — keeping a dozen live is an OOM kill, and the difference is over a gigabyte. A fixture that only needs an option value costs far less than one whose `system.build.toplevel` is forced, so force deliberately: forcing is what runs the module assertions, and skipping it is what makes a check vacuous.**One peak measurement proves nothing about a tree.** The evaluator's collector sizes its heap against the memory the box has free, so peak RSS is a property of the tree *and* the machine's state, anti-correlated with load. Measured on one unchanged check, three consecutive `nix build --no-eval-cache` runs on an idle box: 4.85, 4.38, 3.63 GiB — a 1.2 GiB spread, falling monotonically as the page cache filled. So a single run per tree cannot resolve a half-gigabyte change in either direction, and a before/after comparison built that way is noise. Interleave repeated runs and report the spread, or gate the expensive read behind a flag and compare it against itself. This is the same mechanism as the `GC_MAXIMUM_HEAP_SIZE` warning: free memory acts as an implicit bound, and under a bound the collector simply works harder.these two pgphs also read as a waste of time. delete them or cut to the bone
4c8ed35ca2to19722b17f719722b17f7to3902303a33View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.