Skip to content

Use structured data for string contexts. - #48

Closed
shlevy wants to merge 1 commit into
NixOS:masterfrom
shlevy:structured-context
Closed

shlevy wants to merge 1 commit into
NixOS:masterfrom
shlevy:structured-context

Conversation

@shlevy

@shlevy shlevy commented Sep 2, 2012

Copy link
Copy Markdown
Member

Rather than relying on magic characters and string scanning to extract information out of a string context, a string's context is now a structured data type.

To avoid fragmentation and extra allocations, the context struct and the memory for the strings it points to are all allocated in one call.

Rather than relying on magic characters and string scanning to extract information out of a string context, a string's context is now a structured data type.

To avoid fragmentation and extra allocations, the context struct and the memory for the strings it points to are all allocated in one call.
@shlevy

shlevy commented Jul 2, 2013

Copy link
Copy Markdown
Member Author

Giving up on this getting merged

@shlevy shlevy closed this Jul 2, 2013
meditans pushed a commit to Ericson2314/nix that referenced this pull request Aug 28, 2020
P-E-Meunier pushed a commit to P-E-Meunier/nix that referenced this pull request Feb 26, 2025
Fix double-escape of nix strings for build dependencies
edolstra referenced this pull request in DeterminateSystems/nix-src Mar 5, 2025
ConnorBaker pushed a commit to ConnorBaker/nix that referenced this pull request Jul 25, 2025
ConnorBaker added a commit to ConnorBaker/nix that referenced this pull request May 22, 2026
Each candidate that has been addressed by a pushed cleanup branch now
carries a **Branch:** line under its **Validation:** paragraph, naming
the vibe-coding/cleanup/* branch on origin that lands the change.

Cross-references:
- vibe-coding/cleanup/libexpr-friend-dup -> NixOS#217 (duplicate-line removal
  only; the broader Counter -> Statistics promotion remains as future
  work)
- vibe-coding/cleanup/libfetchers-curl-stub -> NixOS#52
- vibe-coding/cleanup/libflake-lockfile -> NixOS#48
- vibe-coding/cleanup/libmain-shared -> NixOS#49, NixOS#128
- vibe-coding/cleanup/libstore-dead-decls -> NixOS#54, NixOS#56, NixOS#57, NixOS#60
- vibe-coding/cleanup/libutil-misc -> NixOS#58, NixOS#130
- vibe-coding/cleanup/nix-run -> NixOS#127, NixOS#142

Two non-branch outcomes folded in:
- NixOS#50 (nix_value_incref forwarders): resolved-by-design after re-reading
  the C-API header. The forwarders are the migration *target*, not the
  debt; the typed nix_value_decref form supersedes the @deprecated
  generic nix_gc_decref. No code change.
- NixOS#148 (windowSize() un-leak): reclassified INVALID after an adversarial
  review pass identified a static-destruction-order hazard. The leak is
  load-bearing because ~ProgressBar runs from static destruction and
  the in-flight update-thread draw() iteration calls
  getWindowSize() -> windowSize().lock(). A function-local static would
  be destroyed before that lock; UAM. Same hazard class as
  getInterruptCallbacks; documented in the expanded comment landed on
  vibe-coding/cleanup/libutil-misc.

NixOS#56 (BaseSetting<SandboxMode>::trait header move) and NixOS#57 (COMMA_ macro
hygiene) gained extra detail: NixOS#56 is also a real ODR fix (different TUs
saw different definitions of the explicit specialisation), and NixOS#57's
implementing PR also caught a third leaking macro
(LENGTH_PREFIXED_PROTO_HELPER_X) that the original framing missed.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ConnorBaker added a commit to ConnorBaker/nix that referenced this pull request May 23, 2026
…eck()

A bare `void check();` declaration sat in the `nix::flake` namespace inside
`lockfile.cc`, immediately after the definition of `LockFile::check()`. It
had no definition and no callers; it was a leftover from an editing
accident. Remove it. The legitimate `LockFile::check()` member declaration
in the header is untouched.

Refs candidate NixOS#48.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ConnorBaker added a commit to ConnorBaker/nix that referenced this pull request May 23, 2026
…xes + libmain code-review parity

Final cleanup pass after the bidirectional traceability audit.

Audit findings: 0 phantom Branch lines, 0 wrong-fix commits, 7
orphan commits (bodies missing Refs candidate lines), 4 stale
Branch line texts where Pass-B amends shifted the implementation
without updating the catalog.

All 7 orphans fixed via per-shard rebase amends adding the missing
candidate references (libexpr 18-commit rebase for NixOS#217,
libfetchers 2-commit rebase for NixOS#52, libflake 2-commit rebase for
NixOS#48, libmain single-commit amend for NixOS#49+NixOS#128, libstore 23-commit
rebase for NixOS#54+NixOS#56+NixOS#57+NixOS#60, libutil 7-commit rebase for NixOS#58+NixOS#130
and the NixOS#148-tied catalog-cleanup commit, nix-cli 12-commit rebase
for NixOS#127+NixOS#142). All 4 stale Branch lines re-synced.

`/code-review` skill brought to parity on libmain — three-agent
fan-out reported clean across reuse / quality / efficiency.

Final tip SHAs after the orphan-fix rebases: libexpr 9d33402cc,
libfetchers dc5dc00, libflake fd75c93, libmain f9da474,
libstore e7e885bc3, libutil 18a82b524, nix-cli ef32368.

All seven branches still Local-only past their pushed tips; push
policy is explicit-only.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
angerman added a commit to angerman/nix that referenced this pull request Aug 5, 2026
…bail

The hard part of J2: a JIT'd body must produce the interpreter's EXACT NaN-boxed
Value bits or bail. Extended the aarch64 encoder (jit.hh) with andReg/orrReg/sbfx,
and proved a JIT'd integer ADD over v3 Values:
  - mask+compare to INT_HEADER (0x7FF2.. = box(codeOf(Int=1)=2,0)); bail if either
    operand is not an inline-int,
  - sbfx #0,NixOS#48 unbox (48-bit sign-extend), add, re-sbfx+cmp 48-bit overflow check
    (bail on overflow -> the interpreter would heap-box it),
  - orr re-box.
research/jit_intop_test.cc EXECUTES it on aarch64: 7/7 int-add cases byte-identical
to the v8nan reference codec (incl edge-of-48-bit), and 4/4 bail cases correct
(overflow both signs, non-int float lhs/rhs). ALL PASS.

Validated on the laptop (aarch64-darwin; correctness is host-independent). This +
J1 prove the JIT can emit bit-exact Value ops. REMAINING for a shippable JIT:
the value-stack ABI + trampoline (LR save), a full body emitter, VM integration
(compile on hot callCount, bail on unsupported shapes), and J3 GC-safepoints for
ALLOCATING bodies -- the shippable real-world win needs J3 (nixpkgs hot bodies
allocate; pure-arith coverage alone is ~0). The multi-week dedicated remainder.
roberth added a commit to roberth/nix that referenced this pull request Aug 9, 2026
…le, §10, §16)

Batches tasks NixOS#42, NixOS#44, NixOS#45, NixOS#46, NixOS#47, NixOS#48:
- Add WalkHit entry in §6 with {resultHash, terminalCur} shape
- Add EvolutionStep entry in §17 (was referenced, never defined)
- Retitle §14 'argAncestry' (drop 'the enclosing scope of a subject' — 'scope' was the word we eliminated)
- Trim §16 argCell redundant sentence
- Reword §10 opening ('probed the other way around' → 'the other side probes')
- Deduplicate §17 SubjectEvolutionEdge — schema now referenced from §18 rather than restated

Task NixOS#41 (define EvolutionStep) subsumed by the §17 addition.

Assisted-by: Claude Code (Claude Opus 4.6-4.7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant