{
  "samples": [
    {
      "starting": {
        "case": "markdown-code-64",
        "mode": "local",
        "wrap": false,
        "repetition": 1
      }
    },
    {
      "visibilityMode": "local",
      "textVisibility": [
        {
          "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": 0,
          "highlightVisible": true,
          "inputScope": "2",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": false,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 15.899999998509884,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 15.799999997019768,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 156.60000000149012,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 156.5,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 174.80000000447035,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "4",
          "paintVisibility": "visible"
        },
        {
          "atMs": 174.70000000298023,
          "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": "b4c9aa7873143fe123efa2ddf4c2eb7c7b69eddd",
        "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": "e75899c6182bae15ddc3582288f3738746fb03edb9ecbc604ff8964f4f17947a",
          "frontend/src/state_actions/editor.rs": "296c30103a8e28f563cae1ddfdad4b04b3863df4e50b068adec13322a6580d1c",
          "frontend/src/state_actions/editor/preparation.rs": "ea167fe490a988bfee31532cbf8de40eb35d6e32151c0ec8e2836ee131331802",
          "frontend/src/state_actions/editor/rows.rs": "8265eec3bc031672a9b7b3ad9938996308e619e2ba7037b5c247dcbe2247ff13"
        },
        "backendWasmSha256": "8efc2579446963f530f5774fdcbe2223bbc6b974eb54d8221a768ff1c43232af",
        "measurementScriptSha256": "8e810dc178ce0a2469a6b6f315d92896ed81cdc51a359c17fe521af4596d001e",
        "frontendWasmSha256": {
          "openwebide-frontend-a6d5edf9a4389430_bg.wasm": "929cecebf1793d82fe590beda3acdb752bd6648afb12f9076bf273f0c7d2055a"
        },
        "scope": "Uncommitted bounded early retained-syntax viewport publication on b4c9aa7; retained backend and unchanged visibility probe."
      },
      "cpuProfiling": false,
      "case": "markdown-code-64",
      "fileName": "measure.md",
      "mode": "local",
      "wrap": false,
      "repetition": 1,
      "sourceBytes": 65468,
      "inputPosition": "beginning",
      "verifiedSourceCaretBeforeInput": 0,
      "completeSourceAfterInputVerified": true,
      "loadToPaintMs": 1095.5047509996803,
      "appModule": "/openwebide-frontend-a6d5edf9a4389430.js",
      "clientWidth": 248,
      "domNodes": 808,
      "maxFrameMs": 50.10000000000002,
      "nativeBound": true,
      "nativeInputLength": 11586,
      "paintRows": 33,
      "scrollHeight": 18315,
      "scrollWidth": 545,
      "styledString": false,
      "wasmCommittedBytes": 22806528,
      "wrapped": false,
      "scrollAxis": "vertical",
      "scrollOffset": 12821,
      "scrollToPaintMs": 15.399999998509884,
      "inputToPaintMs": 41.29999999701977,
      "chrome_processes": 9,
      "chrome_summed_rss_kib": 1347168,
      "chrome_pss_kib": 724581,
      "memorySnapshotAttempts": 1,
      "afterInputMemory": {
        "chrome_processes": 9,
        "chrome_summed_rss_kib": 1251984,
        "chrome_pss_kib": 625480,
        "memorySnapshotAttempts": 1
      },
      "beforeLoadMemory": {
        "chrome_processes": 9,
        "chrome_summed_rss_kib": 995952,
        "chrome_pss_kib": 403471,
        "memorySnapshotAttempts": 1
      },
      "peakChromeSummedRssKiB": 1291976,
      "peakChromePssKiB": 672842,
      "memorySamples": 13,
      "memorySampleIntervalMs": 200,
      "coldViewportPaintMs": 1057.6000000014901,
      "coldCompleteGeometryMs": 1057.6000000014901,
      "coldViewportHadCompleteExtent": true,
      "inputViewportPaintMs": 15.700000002980232,
      "inputCompleteGeometryMs": 31.799999997019768,
      "inputViewportHadCompleteExtent": false,
      "inputScrollTop": 2,
      "inputScrollLeft": 0,
      "afterInputWasmCommittedBytes": 24576000,
      "longTasks": 2,
      "longTaskMs": 117,
      "maxLongTaskMs": 67,
      "maxFrameIncludingInputMs": 50.10000000000002
    },
    {
      "starting": {
        "case": "markdown-code-64",
        "mode": "remote",
        "wrap": false,
        "repetition": 1
      }
    },
    {
      "visibilityMode": "remote",
      "textVisibility": [
        {
          "atMs": 0.20000000298023224,
          "highlightVisible": true,
          "inputScope": "2",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": false,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 0,
          "highlightVisible": true,
          "inputScope": "2",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": false,
          "nativeOpacity": "1",
          "paintMarker": false,
          "paintScope": "2",
          "paintVisibility": "visible"
        },
        {
          "atMs": 17,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 16.799999997019768,
          "highlightVisible": true,
          "inputScope": "3",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 153.5,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 153.29999999701977,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "3",
          "paintVisibility": "visible"
        },
        {
          "atMs": 172.70000000298023,
          "highlightVisible": true,
          "inputScope": "4",
          "nativeBound": "true",
          "nativeColor": "rgba(0, 0, 0, 0)",
          "nativeMarker": true,
          "nativeOpacity": "1",
          "paintMarker": true,
          "paintScope": "4",
          "paintVisibility": "visible"
        },
        {
          "atMs": 172.5,
          "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": "b4c9aa7873143fe123efa2ddf4c2eb7c7b69eddd",
        "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": "e75899c6182bae15ddc3582288f3738746fb03edb9ecbc604ff8964f4f17947a",
          "frontend/src/state_actions/editor.rs": "296c30103a8e28f563cae1ddfdad4b04b3863df4e50b068adec13322a6580d1c",
          "frontend/src/state_actions/editor/preparation.rs": "ea167fe490a988bfee31532cbf8de40eb35d6e32151c0ec8e2836ee131331802",
          "frontend/src/state_actions/editor/rows.rs": "8265eec3bc031672a9b7b3ad9938996308e619e2ba7037b5c247dcbe2247ff13"
        },
        "backendWasmSha256": "8efc2579446963f530f5774fdcbe2223bbc6b974eb54d8221a768ff1c43232af",
        "measurementScriptSha256": "8e810dc178ce0a2469a6b6f315d92896ed81cdc51a359c17fe521af4596d001e",
        "frontendWasmSha256": {
          "openwebide-frontend-a6d5edf9a4389430_bg.wasm": "929cecebf1793d82fe590beda3acdb752bd6648afb12f9076bf273f0c7d2055a"
        },
        "scope": "Uncommitted bounded early retained-syntax viewport publication on b4c9aa7; retained backend and unchanged visibility probe."
      },
      "cpuProfiling": false,
      "case": "markdown-code-64",
      "fileName": "measure.md",
      "mode": "remote",
      "wrap": false,
      "repetition": 1,
      "sourceBytes": 65468,
      "inputPosition": "beginning",
      "verifiedSourceCaretBeforeInput": 0,
      "completeSourceAfterInputVerified": true,
      "loadToPaintMs": 1106.6446260010707,
      "appModule": "/openwebide-frontend-a6d5edf9a4389430.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": 14.899999998509884,
      "inputToPaintMs": 55.20000000298023,
      "chrome_processes": 9,
      "chrome_summed_rss_kib": 1343116,
      "chrome_pss_kib": 717310,
      "memorySnapshotAttempts": 1,
      "afterInputMemory": {
        "chrome_processes": 9,
        "chrome_summed_rss_kib": 1247212,
        "chrome_pss_kib": 624810,
        "memorySnapshotAttempts": 1
      },
      "beforeLoadMemory": {
        "chrome_processes": 9,
        "chrome_summed_rss_kib": 984208,
        "chrome_pss_kib": 397484,
        "memorySnapshotAttempts": 1
      },
      "peakChromeSummedRssKiB": 1286184,
      "peakChromePssKiB": 666288,
      "memorySamples": 13,
      "memorySampleIntervalMs": 200,
      "coldViewportPaintMs": 1063.4000000059605,
      "coldCompleteGeometryMs": 1063.4000000059605,
      "coldViewportHadCompleteExtent": true,
      "inputViewportPaintMs": 16.700000002980232,
      "inputCompleteGeometryMs": 33.399999998509884,
      "inputViewportHadCompleteExtent": false,
      "inputScrollTop": 2,
      "inputScrollLeft": 0,
      "afterInputWasmCommittedBytes": 24772608,
      "longTasks": 1,
      "longTaskMs": 67,
      "maxLongTaskMs": 67,
      "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-early-pending-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-early-pending-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"
}
