{
  "samples": [
    {
      "starting": {
        "case": "markdown-code-64",
        "mode": "local",
        "wrap": false,
        "repetition": 1
      }
    },
    {
      "visibilityMode": "local",
      "textVisibility": [
        {
          "atMs": 0.09999999403953552,
          "highlightVisible": true,
          "inputScope": "2",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": false,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 0.10000000149011612,
          "highlightVisible": true,
          "inputScope": "2",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": false,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 9.099999994039536,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 9,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 28.099999994039536,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 28,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 143.29999999701977,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 143.30000000447035,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 159.29999999701977,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "4",
          "paintVisibility": "visible"
        },
        {
          "atMs": 159.20000000298023,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "4",
          "paintVisibility": "visible"
        }
      ]
    },
    {
      "cohort": "embedded-markdown-visible-text",
      "runtime": {
        "sourceHead": "cdc8a2368cdaf9ef6536ad9cde86523b87a14d5f",
        "sourceFilesSha256": {
          "crates/core/src/highlight/paint.rs": "deb322ff9ac37b5c2dbd8502cf819a8f9c1bfb17c761eff7040582be7f92dbe3",
          "crates/core/src/highlight.rs": "0eafda9e669f5e71f044dbc73f22742b3509493d62840c5d9b68807db1796df1",
          "crates/core/src/editor/paint_runs.rs": "5f9a6aac419ae7ae5e911e0b3e52b34ef01d118d19e2ff528aa72a76f1ed869f",
          "frontend/src/components/editor.rs": "174878f935949e7f38a73efcc9eac8a37f0df3513e3e19b03f9d33c71719744d",
          "frontend/src/state_actions/editor.rs": "296c30103a8e28f563cae1ddfdad4b04b3863df4e50b068adec13322a6580d1c",
          "frontend/src/state_actions/editor/preparation.rs": "6aac00c0f54a4e8c5745341c85f90e290ee21cacbae5c0d348855f6d2c68f2ba",
          "frontend/src/state_actions/editor/rows.rs": "8265eec3bc031672a9b7b3ad9938996308e619e2ba7037b5c247dcbe2247ff13"
        },
        "backendWasmSha256": "8efc2579446963f530f5774fdcbe2223bbc6b974eb54d8221a768ff1c43232af",
        "measurementScriptSha256": "8e810dc178ce0a2469a6b6f315d92896ed81cdc51a359c17fe521af4596d001e",
        "frontendWasmSha256": {
          "openwebide-frontend-ce70067f350b94db_bg.wasm": "bbb6bc4c5bceef949c0f8787b5a7d0ba7a915dbd3ec9284d49179ad27d8c2993"
        },
        "scope": "Uncommitted retained current-source syntax spans and provisional-to-final geometry handoff; same retained backend as recorded visibility baseline."
      },
      "cpuProfiling": false,
      "case": "markdown-code-64",
      "fileName": "measure.md",
      "mode": "local",
      "wrap": false,
      "repetition": 1,
      "sourceBytes": 65468,
      "inputPosition": "beginning",
      "verifiedSourceCaretBeforeInput": 0,
      "completeSourceAfterInputVerified": true,
      "loadToPaintMs": 1113.3644169967738,
      "appModule": "/openwebide-frontend-ce70067f350b94db.js",
      "clientWidth": 248,
      "domNodes": 808,
      "maxFrameMs": 66.60000000000002,
      "nativeBound": true,
      "nativeInputLength": 11586,
      "paintRows": 33,
      "scrollHeight": 18315,
      "scrollWidth": 545,
      "styledString": false,
      "wasmCommittedBytes": 22806528,
      "wrapped": false,
      "scrollAxis": "vertical",
      "scrollOffset": 12821,
      "scrollToPaintMs": 25.600000001490116,
      "inputToPaintMs": 29.900000005960464,
      "chrome_processes": 9,
      "chrome_summed_rss_kib": 1351760,
      "chrome_pss_kib": 713017,
      "memorySnapshotAttempts": 1,
      "afterInputMemory": {
        "chrome_processes": 9,
        "chrome_summed_rss_kib": 1265020,
        "chrome_pss_kib": 627311,
        "memorySnapshotAttempts": 1
      },
      "beforeLoadMemory": {
        "chrome_processes": 9,
        "chrome_summed_rss_kib": 1003060,
        "chrome_pss_kib": 410203,
        "memorySnapshotAttempts": 1
      },
      "peakChromeSummedRssKiB": 1303844,
      "peakChromePssKiB": 674304,
      "memorySamples": 13,
      "memorySampleIntervalMs": 200,
      "coldViewportPaintMs": 1080.7999999970198,
      "coldCompleteGeometryMs": 1080.7999999970198,
      "coldViewportHadCompleteExtent": true,
      "inputViewportPaintMs": 27.900000005960464,
      "inputCompleteGeometryMs": 27.900000005960464,
      "inputViewportHadCompleteExtent": true,
      "inputScrollTop": 2,
      "inputScrollLeft": 0,
      "afterInputWasmCommittedBytes": 24576000,
      "longTasks": 2,
      "longTaskMs": 141,
      "maxLongTaskMs": 76,
      "maxFrameIncludingInputMs": 66.60000000000002
    },
    {
      "starting": {
        "case": "markdown-code-64",
        "mode": "remote",
        "wrap": false,
        "repetition": 1
      }
    },
    {
      "visibilityMode": "remote",
      "textVisibility": [
        {
          "atMs": 0.09999999403953552,
          "highlightVisible": true,
          "inputScope": "2",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": false,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 0.10000000149011612,
          "highlightVisible": true,
          "inputScope": "2",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": false,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 12.799999997019768,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 12.700000002980232,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 32.899999998509884,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 32.80000000447035,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 147,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 146.90000000596046,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 164,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "4",
          "paintVisibility": "visible"
        },
        {
          "atMs": 163.90000000596046,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "4",
          "paintVisibility": "visible"
        }
      ]
    },
    {
      "cohort": "embedded-markdown-visible-text",
      "runtime": {
        "sourceHead": "cdc8a2368cdaf9ef6536ad9cde86523b87a14d5f",
        "sourceFilesSha256": {
          "crates/core/src/highlight/paint.rs": "deb322ff9ac37b5c2dbd8502cf819a8f9c1bfb17c761eff7040582be7f92dbe3",
          "crates/core/src/highlight.rs": "0eafda9e669f5e71f044dbc73f22742b3509493d62840c5d9b68807db1796df1",
          "crates/core/src/editor/paint_runs.rs": "5f9a6aac419ae7ae5e911e0b3e52b34ef01d118d19e2ff528aa72a76f1ed869f",
          "frontend/src/components/editor.rs": "174878f935949e7f38a73efcc9eac8a37f0df3513e3e19b03f9d33c71719744d",
          "frontend/src/state_actions/editor.rs": "296c30103a8e28f563cae1ddfdad4b04b3863df4e50b068adec13322a6580d1c",
          "frontend/src/state_actions/editor/preparation.rs": "6aac00c0f54a4e8c5745341c85f90e290ee21cacbae5c0d348855f6d2c68f2ba",
          "frontend/src/state_actions/editor/rows.rs": "8265eec3bc031672a9b7b3ad9938996308e619e2ba7037b5c247dcbe2247ff13"
        },
        "backendWasmSha256": "8efc2579446963f530f5774fdcbe2223bbc6b974eb54d8221a768ff1c43232af",
        "measurementScriptSha256": "8e810dc178ce0a2469a6b6f315d92896ed81cdc51a359c17fe521af4596d001e",
        "frontendWasmSha256": {
          "openwebide-frontend-ce70067f350b94db_bg.wasm": "bbb6bc4c5bceef949c0f8787b5a7d0ba7a915dbd3ec9284d49179ad27d8c2993"
        },
        "scope": "Uncommitted retained current-source syntax spans and provisional-to-final geometry handoff; same retained backend as recorded visibility baseline."
      },
      "cpuProfiling": false,
      "case": "markdown-code-64",
      "fileName": "measure.md",
      "mode": "remote",
      "wrap": false,
      "repetition": 1,
      "sourceBytes": 65468,
      "inputPosition": "beginning",
      "verifiedSourceCaretBeforeInput": 0,
      "completeSourceAfterInputVerified": true,
      "loadToPaintMs": 1105.8026669998071,
      "appModule": "/openwebide-frontend-ce70067f350b94db.js",
      "clientWidth": 248,
      "domNodes": 813,
      "maxFrameMs": 50,
      "nativeBound": true,
      "nativeInputLength": 11586,
      "paintRows": 34,
      "scrollHeight": 18315,
      "scrollWidth": 545,
      "styledString": false,
      "wasmCommittedBytes": 23003136,
      "wrapped": false,
      "scrollAxis": "vertical",
      "scrollOffset": 12821,
      "scrollToPaintMs": 18.899999998509884,
      "inputToPaintMs": 35.400000005960464,
      "chrome_processes": 9,
      "chrome_summed_rss_kib": 1314232,
      "chrome_pss_kib": 715431,
      "memorySnapshotAttempts": 1,
      "afterInputMemory": {
        "chrome_processes": 9,
        "chrome_summed_rss_kib": 1235060,
        "chrome_pss_kib": 622613,
        "memorySnapshotAttempts": 1
      },
      "beforeLoadMemory": {
        "chrome_processes": 9,
        "chrome_summed_rss_kib": 968472,
        "chrome_pss_kib": 393187,
        "memorySnapshotAttempts": 1
      },
      "peakChromeSummedRssKiB": 1271668,
      "peakChromePssKiB": 664948,
      "memorySamples": 13,
      "memorySampleIntervalMs": 200,
      "coldViewportPaintMs": 1066.5,
      "coldCompleteGeometryMs": 1066.5,
      "coldViewportHadCompleteExtent": true,
      "inputViewportPaintMs": 32.70000000298023,
      "inputCompleteGeometryMs": 32.70000000298023,
      "inputViewportHadCompleteExtent": true,
      "inputScrollTop": 2,
      "inputScrollLeft": 0,
      "afterInputWasmCommittedBytes": 24772608,
      "longTasks": 1,
      "longTaskMs": 66,
      "maxLongTaskMs": 66,
      "maxFrameIncludingInputMs": 50
    }
  ],
  "visibilityProbe": "import runpy,json,pathlib,hashlib,sys,subprocess,os\nroot=pathlib.Path('/workspace/repos/openwebide');manifest=json.loads(pathlib.Path('/fixture/manifest.json').read_text());sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest()\nassert {p.name:sha(p) for p in (root/'frontend/dist').glob('*.wasm')}==manifest['frontendWasmSha256']\nassert sha(root/'target/wasm32-wasip2/release/openwebide_backend.wasm')==manifest['backendWasmSha256']\nassert sha(root/'tools/measure-editor-view.py')==manifest['measurementScriptSha256']\nmodule=runpy.run_path(str(root/'tools/measure-editor-view.py'))\ndef embedded_source(case):\n size=int(case.rsplit('-',1)[1])*1024\n prefix,suffix=('```javascript\\n','```\\n')\n pattern='function run() {} // \u6587\ud83d\ude00 padding ................................\\n'\n return prefix+pattern*((size-len((prefix+suffix).encode()))//len(pattern.encode()))+suffix\nprobe=r'''\nwindow.editorTextVisibility=[];\ndocument.addEventListener('beforeinput', event=>{\n if(!event.target.matches('textarea[data-editor-path]'))return;\n const input=event.target,start=performance.now();let last;\n function observe(){\n  const code=input.parentElement,paint=code.querySelector('.editor-highlight-content');\n  const style=getComputedStyle(input),first=paint?.querySelector('.editor-source-line');\n  const record={nativeMarker:input.value.startsWith('z'),nativeBound:input.dataset.editorNativeBound,\n   nativeColor:style.color,nativeOpacity:style.opacity,highlightVisible:code.classList.contains('highlight-ready'),\n   paintMarker:first?.textContent.startsWith('z')??false,inputScope:input.dataset.editorScope,\n   paintScope:paint?.dataset.editorScope,paintVisibility:paint?getComputedStyle(paint).visibility:null};\n  const encoded=JSON.stringify(record);\n  if(encoded!==last){window.editorTextVisibility.push({atMs:performance.now()-start,...record});last=encoded;}\n  if(performance.now()-start<600)requestAnimationFrame(observe);\n }\n observe();requestAnimationFrame(observe);\n},true);\n'''\nBase=module['Browser']\nclass ObservedBrowser(Base):\n def call(self,method,path,payload=None,**kwargs):\n  if method=='POST' and path=='/url':\n   super().call('POST','/goog/cdp/execute',{'cmd':'Page.addScriptToEvaluateOnNewDocument','params':{'source':probe}})\n  return super().call(method,path,payload,**kwargs)\n def script(self,script,*args,**kwargs):\n  if script.startswith('return {...window.editorViewMeasurement,'):\n   script=script.replace('return {','return {textVisibility:window.editorTextVisibility,',1)\n  result=super().script(script,*args,**kwargs)\n  if isinstance(result,dict) and 'textVisibility' in result: print(json.dumps({'visibilityMode':sys.argv[1],'textVisibility':result['textVisibility']}),flush=True)\n  return result\nmodule['measure'].__globals__['Browser']=ObservedBrowser\nmodule['measure'].__globals__['source_for']=embedded_source\nmode=sys.argv[1];repetition=int(sys.argv[3]);case=sys.argv[5]\nresult=module['measure'](case,mode,False,False,repetition,'beginning',False,'measure.md')\nassert result['completeSourceAfterInputVerified'] is True\nassert result['peakChromePssKiB'] is not None\nprint(json.dumps({'cohort':'embedded-markdown-visible-text','runtime':manifest,**result}),flush=True)\n",
  "controller": "import subprocess,pathlib,json\nfixture=pathlib.Path('/private/tmp/openwebide-retained-span-production')\nfor case in ['markdown-code-64']:\n for wrapped in [False]:\n  for repetition in [1]:\n   for mode in ['local','remote']:\n    name='openwebide-retained-span-visibility-'+case+'-'+mode+'-'+str(wrapped).lower()+'-'+str(repetition)\n    cmd=['docker','run','--rm','--init','--name',name,'--cpus','4','--memory','10g','--shm-size','1g','--entrypoint','python3',\n     '-v',str(fixture)+'/frontend/dist:/workspace/repos/openwebide/frontend/dist:ro',\n     '-v',str(fixture)+'/backend.wasm:/workspace/repos/openwebide/target/wasm32-wasip2/release/openwebide_backend.wasm:ro',\n     '-v',str(fixture)+'/spin.toml:/workspace/repos/openwebide/spin.toml:ro',\n     '-v',str(fixture)+'/tools:/workspace/repos/openwebide/tools:ro',\n     '-v',str(fixture)+':/fixture:ro','-v',str(fixture)+'/embedded-visibility.py:/sample.py:ro',\n     'openwebide:editor-view-measurements','/sample.py',mode,str(wrapped).lower(),str(repetition),'embedded-markdown-visible-text',case]\n    print(json.dumps({'starting':{'case':case,'mode':mode,'wrap':wrapped,'repetition':repetition}}),flush=True)\n    subprocess.run(cmd,check=True)\n"
}
