PageSourceSearch

https://noir-lang.org/docs/assets/js/e1c73325.bb637e5b.js

js noir-lang.org collected 2026-10-03 22:49:56 UTC 7,326 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkdocs=globalThis.webpackChunkdocs||[]).push([[310],{96837(e,n,t){t.d(n,{Ay:()=>s});var i=t(74848),o=t(28453);function r(e){const n={a:"a",admonition:"admonition",p:"p",strong:"strong",...(0,o.R)(),...e.components};return(0,i.jsxs)(n.admonition,{title:"Experimental Feature",type:"caution",children:[(0,i.jsx)(n.p,{children:"This feature is experimental. The documentation may be incomplete or out of date, which means it could change in future versions, potentially causing unexpected behavior or not working as expected."}),(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Contributions Welcome:"})," If you notice any inaccuracies or potential improvements, please consider contributing. Visit our GitHub repository to make your contributions: ",(0,i.jsx)(n.a,{href:"https://github.com/noir-lang/noir",children:"Contribute Here"}),"."]})]})}function s(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(r,{...e})}):r(e)}t.d(n,["RM",0,[]])},19017(e,n,t){t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>g,frontMatter:()=>a,metadata:()=>i,toc:()=>l});const i=JSON.parse('{"id":"tooling/debugger/debugger_known_limitations","title":"Known limitations","description":"An overview of known limitations of the current version of the Noir debugger","source":"@site/versioned_docs/version-v1.0.0-rc.2/tooling/debugger/debugger_known_limitations.mdx","sourceDirName":"tooling/debugger","slug":"/tooling/debugger/debugger_known_limitations","permalink":"/docs/tooling/debugger/debugger_known_limitations","draft":false,"unlisted":false,"editUrl":"https://github.com/noir-lang/noir/edit/master/docs/versioned_docs/version-v1.0.0-rc.2/tooling/debugger/debugger_known_limitations.mdx","tags":[],"version":"v1.0.0-rc.2","frontMatter":{"title":"Known limitations","description":"An overview of known limitations of the current version of the Noir debugger","keywords":["Nargo","Noir Debugger","VS Code"]},"sidebar":"sidebar","previous":{"title":"REPL Debugger","permalink":"/docs/tooling/debugger/debugger_repl"},"next":{"title":"Fuzzer","permalink":"/docs/tooling/fuzzer"}}');var o=t(74848),r=t(28453),s=t(96837);const a={title:"Known limitations",description:"An overview of known limitations of the current version of the Noir debugger",keywords:["Nargo","Noir Debugger","VS Code"]},c="Debugger Known Limitations",d={},l=[...s.RM,{value:"Mutable references",id:"mutable-references",level:2},{value:"Variables of type function or mutable references are opaque",id:"variables-of-type-function-or-mutable-references-are-opaque",level:2},{value:"Debugger instrumentation affects resulting ACIR",id:"debugger-instrumentation-affects-resulting-acir",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"debugger-known-limitations",children:"Debugger Known Limitations"})}),"\n","\n",(0,o.jsx)(s.Ay,{}),"\n",(0,o.jsx)(n.p,{children:"There are currently some limits to what the debugger can observe."}),"\n",(0,o.jsx)(n.h2,{id:"mutable-references",children:"Mutable references"}),"\n",(0,o.jsx)(n.p,{children:"The debugger is currently blind to any state mutated via a mutable reference. For example, in:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"let mut x = 1;\nlet y = &mut x;\n*y = 2;\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The update on ",(0,o.jsx)(n.code,{children:"x"})," will not be observed by the debugger. That means, when running ",(0,o.jsx)(n.code,{children:"vars"})," from the debugger REPL, or inspecting the ",(0,o.jsx)(n.em,{children:"local variables"})," pane in the VS Code debugger, ",(0,o.jsx)(n.code,{children:"x"})," will appear with value 1 despite having executed ",(0,o.jsx)(n.code,{children:"*y = 2;"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"variables-of-type-function-or-mutable-references-are-opaque",children:"Variables of type function or mutable references are opaque"}),"\n",(0,o.jsxs)(n.p,{children:["When inspecting variables, any variable of type ",(0,o.jsx)(n.code,{children:"Function"})," or ",(0,o.jsx)(n.code,{children:"MutableReference"})," will render its value as ",(0,o.jsx)(n.code,{children:"<<function>>"})," or ",(0,o.jsx)(n.code,{children:"<<mutable ref>>"}),"."]}
1),"\n",(0,o.jsx)(n.h2,{id:"debugger-instrumentation-affects-resulting-acir",children:"Debugger instrumentation affects resulting ACIR"}),"\n",(0,o.jsxs)(n.p,{children:["In order to make the state of local variables observable, the debugger compiles Noir circuits interleaving foreign calls that track any mutations to them. While this works (except in the cases described above) and doesn't introduce any behavior changes, it does as a side effect produce bigger bytecode. In particular, when running the command ",(0,o.jsx)(n.code,{children:"opcodes"})," on the REPL debugger, you will notice Unconstrained VM blocks that look like this:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'...\n5    BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [], q_c: 2 }), Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(2))], q_c: 0 })]\n       |       outputs=[]\n  5.0  |   Mov { destination: RegisterIndex(2), source: RegisterIndex(0) }\n  5.1  |   Mov { destination: RegisterIndex(3), source: RegisterIndex(1) }\n  5.2  |   Const { destination: RegisterIndex(0), value: Value { inner: 0 } }\n  5.3  |   Const { destination: RegisterIndex(1), value: Value { inner: 0 } }\n  5.4  |   Mov { destination: RegisterIndex(2), source: RegisterIndex(2) }\n  5.5  |   Mov { destination: RegisterIndex(3), source: RegisterIndex(3) }\n  5.6  |   Call { location: 8 }\n  5.7  |   Stop\n  5.8  |   ForeignCall { function: "__debug_var_assign", destinations: [], inputs: [RegisterIndex(RegisterIndex(2)), RegisterIndex(RegisterIndex(3))] }\n...\n'})}),"\n",(0,o.jsxs)(n.p,{children:["If you are interested in debugging/inspecting compiled ACIR without these synthetic changes, you can invoke the REPL debugger with the ",(0,o.jsx)(n.code,{children:"--skip-instrumentation"})," flag or launch the VS Code debugger with the ",(0,o.jsx)(n.code,{children:"skipConfiguration"})," property set to true in its launch configuration. You can find more details about those in the ",(0,o.jsx)(n.a,{href:"/docs/tooling/debugger/debugger_repl",children:"Debugger REPL reference"})," and the ",(0,o.jsx)(n.a,{href:"/docs/tooling/debugger/debugger_vscode",children:"VS Code Debugger reference"}),"."]}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsx)(n.p,{children:"Skipping debugger instrumentation means you won't be able to inspect values of local variables."})})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(u,{...e})}):u(e)}},28453(e,n,t){t.d(n,{R:()=>s,x:()=>a});var i=t(96540);const o={},r=i.createContext(o);function s(e){const n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.