GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Polylinker: flag-aware router over bundled linkers (LTO/optimized via routing + fallbacks) — design + docs · Issue #30 · forge-ci/reld

Polylinker: flag-aware router over bundled linkers (LTO/optimized via routing + fallbacks) — design + docs #30

New issue
Copy link
New issue
Copy link
Closed
#33
Closed
Polylinker: flag-aware router over bundled linkers (LTO/optimized via routing + fallbacks) — design + docs#30
#33
Copy link
Labels
enhancementNew feature or request

Description

@zackees
zackees
opened on Aug 7, 2026
Issue body actions

Extends #17 (decision B8, flag-based engine routing) and #19 (the "router over engines" that lives in the linker daemon). This issue formalizes the polylinker framing and its fallback semantics, and asks for the docs to be updated to match.

Insight

reld is a fat linker: it bundles multiple real linkers per platform (the native engine + the lld bridge today; radlink and others later). Once that's true, reld can support any linker configuration — including optimized/release links and LTO — not by implementing each feature natively, but by routing the request to whichever bundled linker already supports it. reld becomes a polylinker: a flag-aware router over a fleet of bundled linkers, defaulting to the fastest engine for the platform and escalating to a more capable one only when the requested configuration demands it.

This directly reframes today's LTO story (see "Relationship to locked decisions" below).

Proposal — a flag-aware routing layer

  1. Capability model. Each bundled linker declares which configurations it supports (LTO / ThinLTO, plugin interface, GC-sections, ICF, PDB/DWARF, identity/reproducible output, incremental, per-format: ELF/COFF/Mach-O, etc.). This is a static table plus a probe where cheap.
  2. Router. On each link, inspect the incoming linker request — argv flags (-flto, --plugin, /LTCG, /GL, -O levels, --icf, --gc-sections, identity/strip flags, --engine= explicit override, env) — classify the required configuration, and select the bundled linker whose capabilities cover it. Default: the fastest engine for the platform (the dev-loop path). Escalate: LTO/optimized/release-fidelity → the capable engine (e.g. lld with its LTO/plugin support), even on a platform where the native fast engine exists.
  3. Fallbacks. If the fastest linker can't satisfy a requested configuration, fall back to a capable bundled linker rather than failing — and if no bundled linker supports the configuration, error clearly and specifically (never silently mislink, never silently drop a flag that changes correctness). Fallbacks are ordered by (capability match, then speed).
  4. Explicit override. --engine=<name> / RELD_ENGINE forces a specific bundled linker, bypassing routing (for benchmarking and escape hatches).
  5. Observability / honesty. Every routing decision is logged at note level (reld: engine=<name> (<reason: default|flag:-flto|fallback:...|override>)), and — per the benchmark honesty policy — the benchmark records which engine produced each number (this is the mode/engine field from BR-4b generalized). A user must always be able to tell which real linker ran and why.

The router is the same "router over engines" that #19 places inside the daemon; this issue defines its policy (capabilities + routing + fallbacks), independent of where it physically runs (in-process bridge today, daemon later).

Relationship to locked decisions — read before objecting

docs/plan/01-DECISIONS.md D13 and README/DESIGN currently say LTO is deferred / its flags are "rejected or ignored" until implemented natively. The polylinker reframes this at the product level:

  • LTO is no longer deferred for the user — an -flto link is delegated to a bundled linker that does LTO (strictly better than rejecting it), even though native LTO codegen in reld's own engine remains future work.
  • Per DECISIONS.md's own rule ("if evidence emerges that a locked decision is wrong, raise it as an issue — do not quietly implement the alternative"), this issue is that flag: D13's "reject LTO flags" stance should become "route LTO flags to a capable engine." The fast-inner-loop priority is unchanged — LTO just stops being a dead end.

Docs to update (part of this issue's scope)

Reframe the project as a polylinker everywhere it's described:

  • README.md — the "four claims" / non-goals / stretch-goals sections: reld runs everywhere and supports every linker configuration by routing, with fast defaults and fallbacks. Replace the "LTO flags are rejected" language with "LTO is routed to a capable engine."
  • DESIGN.md — add a "Polylinker: flag-aware routing over bundled engines" section (capability model, routing policy, fallback ordering, honesty/logging); update the LTO section (§ stretch goal) to the routing framing.
  • docs/plan/01-DECISIONS.md — amend/супersede D13 with the routing decision; cross-reference B8 (Bridge linkers: run + benchmark reld on Windows and macOS now by delegating to lld (rust-lld) per platform #17).
  • Agent docs — reld has no agents/docs/ yet; create a short agents/docs/ (or AGENTS.md) note describing the polylinker routing model so future agents implement new backends behind the capability table, not as forks.

Non-goals / cautions

  • Not native LTO/PGO/BOLT in reld's own engine (still future).
  • Routing must never change link correctness silently: an unroutable/unsupported config is a loud error, not a best-effort mislink.
  • Incremental (the daemon, I0-I7: Incremental linking (do not start before P4 is green) #11/Linker daemon: thin reld-link client + broker-versioned daemon holding the object graph (running-process broker v2, zccache-embedded instrumentation) #19) and LTO are mutually exclusive on a given link (D13 note) — the router must not try to combine them.

Done when

DESIGN.md/README.md/DECISIONS.md/agent docs describe reld as a polylinker with the capability + routing + fallback model above; D13 is reconciled; the routing policy is specified precisely enough that B8 (#17) and the daemon router (#19) implement against it. (Implementation of the router itself is tracked by B8/#19 — this issue delivers the design + docs.)

Activity

  1. zackees
    added
    enhancementNew feature or request
    on Aug 7, 2026
  2. zackees
    closed this as completedin #33on Aug 7, 2026
  3. zackees
    added a commit that references this issue on Aug 7, 2026

    feat(bridge): explicit engine override + registry — polylinker router…

    c81fd9a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.