Documentation

Hesper.WGSL.JSTrace

JS-replay trace (DG_TRACE_JS=<outdir>) #

Dumps everything a thin JS+WebGPU replayer needs to re-execute a decode step of the DiffusionGemma engine (the Campaign-3 trace-replay pattern, aimed at Chrome instead of Metal):

Buffer identity = getBufferId (the raw WGPUBuffer handle), already used by the bind-group cache. Write contents are recorded as hex for writes ≤ 64 KB (params, canvases, norms); larger writes (weights) are size-only — their provenance comes from tensors.json.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Hesper.WGSL.JSTrace.kernel (sourceHash : UInt64) (wgsl : String) :

      record a kernel's WGSL at first compile (independent of arming: the pipeline cache means compile happens once, possibly before the traced step).

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Hesper.WGSL.JSTrace.dispatch (sourceHash : UInt64) (name : String) (grid : Nat × Nat × Nat) (bufs : Array (String × UInt64)) :
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Hesper.WGSL.JSTrace.write (uid : UInt64) (offset : Nat) (data : ByteArray) :
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Hesper.WGSL.JSTrace.read (uid : UInt64) (offset size : Nat) (data : ByteArray) :

            readback event; contents ≤ 2MB are recorded so a replayer can gate on bit-equality without porting the CPU logic that consumes them.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Equations
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[inline]
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      FNV-1a 32-bit over the first n bytes (mirrored by the JS replayer).

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For

                          drop accumulated ops (used between the ref-collection step and the recorded replay step).

                          Equations
                          Instances For

                            uids referenced by traced dispatches that have NEITHER GGUF tensor provenance NOR recorded write contents — the derived buffers a replayer must load from .bin dumps.

                            Equations
                            Instances For

                              write ops.jsonl / buffers.json / tensors.json and report.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For