aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-02-17 14:38:42 +0900
committerOphestra <cat@gensokyo.uk>2026-02-17 14:38:42 +0900
commita40527dcb2197e4a3b41a98ed319563171703c66 (patch)
treedfa15465a2bd6e296508c33009dbba9c6fa28900 /internal/pkg
parent88d9a6163e9e91b55b6ebe71f335e7617c76b04e (diff)
internal/pkg/ir: document reason for avoiding ident cache
This got brought up earlier today as a potential optimisation. This change documents why it is not viable, and hopefully clears up some performance implications of using IRDecoder, namely that its decoding costs do not amortise. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg')
-rw-r--r--internal/pkg/ir.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/pkg/ir.go b/internal/pkg/ir.go
index 58dcbfee..73315a85 100644
--- a/internal/pkg/ir.go
+++ b/internal/pkg/ir.go
@@ -310,6 +310,13 @@ type (
// verbose logging is enabled. Artifacts may only depend on artifacts
// previously described in the IR stream.
//
+ // IRDecoder rejects an IR stream on the first decoding error, it does not
+ // check against nonzero reserved ancillary data or incorrectly ordered or
+ // redundant unstructured dependencies. An invalid IR stream as such will
+ // yield [Artifact] values with identifiers disagreeing with those computed
+ // by IRDecoder. For this reason, IRDecoder does not access the ident cache
+ // to avoid putting [Cache] into an inconsistent state.
+ //
// Methods of IRDecoder are not safe for concurrent use.
IRDecoder struct {
// Address of underlying [Cache], must not be exposed directly.