@localmode/bench 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -181,7 +181,12 @@ interface BenchCellResult {
181
181
  error?: {
182
182
  name: string;
183
183
  message: string;
184
+ /** Message of the wrapped provider error, when the thrown error carried a `cause`. */
184
185
  cause?: string;
186
+ /** `name` of the wrapped provider error (e.g. wllama's `RuntimeError` for a WASM abort). */
187
+ causeName?: string;
188
+ /** Stack of the wrapped provider error, capped at 4,000 characters; a WASM abort names its frame only here. */
189
+ causeStack?: string;
185
190
  };
186
191
  }
187
192
  /** Trace events global to the suite run (validity accounting). */
@@ -767,9 +772,17 @@ declare const USAGE_FIDELITY: Record<BenchRuntimeId, ProviderUsage['fidelity']>;
767
772
  interface PlannedCell {
768
773
  model: BenchModelRef;
769
774
  workload: LLMWorkloadSpec | EmbedWorkloadSpec | QualityWorkloadSpec;
775
+ /**
776
+ * When set, the cell is recorded as `skipped` with this reason and never
777
+ * touches the adapter (a lane the submitter switched off, or a build the
778
+ * device cannot run). Keeps every cell a suite defines in the result.
779
+ */
780
+ skipReason?: string;
770
781
  }
771
782
  /** Progress callbacks for a host UI. */
772
783
  interface RunnerHooks {
784
+ /** The environment capture, before the fingerprint and the first cell (lets a host persist partial progress). */
785
+ onEnvironment?(environment: EnvironmentCapture): void;
773
786
  onCellStart?(cellId: string, index: number, total: number): void;
774
787
  onCellFinish?(cell: BenchCellResult): void;
775
788
  onLoadProgress?(cellId: string, pct: number | undefined): void;
package/dist/index.d.ts CHANGED
@@ -181,7 +181,12 @@ interface BenchCellResult {
181
181
  error?: {
182
182
  name: string;
183
183
  message: string;
184
+ /** Message of the wrapped provider error, when the thrown error carried a `cause`. */
184
185
  cause?: string;
186
+ /** `name` of the wrapped provider error (e.g. wllama's `RuntimeError` for a WASM abort). */
187
+ causeName?: string;
188
+ /** Stack of the wrapped provider error, capped at 4,000 characters; a WASM abort names its frame only here. */
189
+ causeStack?: string;
185
190
  };
186
191
  }
187
192
  /** Trace events global to the suite run (validity accounting). */
@@ -767,9 +772,17 @@ declare const USAGE_FIDELITY: Record<BenchRuntimeId, ProviderUsage['fidelity']>;
767
772
  interface PlannedCell {
768
773
  model: BenchModelRef;
769
774
  workload: LLMWorkloadSpec | EmbedWorkloadSpec | QualityWorkloadSpec;
775
+ /**
776
+ * When set, the cell is recorded as `skipped` with this reason and never
777
+ * touches the adapter (a lane the submitter switched off, or a build the
778
+ * device cannot run). Keeps every cell a suite defines in the result.
779
+ */
780
+ skipReason?: string;
770
781
  }
771
782
  /** Progress callbacks for a host UI. */
772
783
  interface RunnerHooks {
784
+ /** The environment capture, before the fingerprint and the first cell (lets a host persist partial progress). */
785
+ onEnvironment?(environment: EnvironmentCapture): void;
773
786
  onCellStart?(cellId: string, index: number, total: number): void;
774
787
  onCellFinish?(cell: BenchCellResult): void;
775
788
  onLoadProgress?(cellId: string, pct: number | undefined): void;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var C="localmode-bench/2",L=2;var Oe=["You are helping a small public library plan its move to a new building across town.","The collection holds forty thousand books, two thousand audio recordings, and a local","history archive that must stay in labeled order. Volunteers are available on weekends","only, and the budget covers one rental truck. Describe a practical week-by-week moving","plan that keeps the library partially open, protects the archive, and finishes within","eight weeks. Be specific about labeling, sequencing, and volunteer coordination."].join(" "),Ue=["Read the following notes from a town planning meeting and then answer the question at the end.","The town of Milbrook has grown from eight thousand residents to eleven thousand in six years.","The old water treatment plant, built fifty years ago, operates at ninety two percent of its","rated capacity during summer months. An engineering survey found that the intake pipes show","corrosion consistent with their age but no immediate risk of failure. Replacing the plant","entirely would cost an estimated thirty one million dollars and take four years, during which","a temporary treatment module would be rented at two hundred thousand dollars per month.","Upgrading the existing plant in three phases would cost nineteen million dollars, take six","years, and raise capacity by forty percent, but phase two requires shutting one of the three","treatment trains for nine months. The town engineer favors the upgrade because the town can","fund it from reserves plus a small bond, avoiding a rate increase larger than four percent.","The finance director notes that construction costs have risen eleven percent in two years and","argues that delaying the full replacement will only make it more expensive, and that a larger","bond issued now at current rates would cost less over thirty years than a later one. Several","residents raised concerns about summer watering restrictions during phase two, and a local","manufacturer that employs three hundred people said an unreliable water supply would force it","to install its own storage tanks at significant cost. The mayor asked both officials to prepare","a comparison covering total cost of ownership over thirty years, resilience during construction,","capacity margins in the final state, and the effect on household water rates under three growth","scenarios: flat, moderate, and rapid. The engineer also mentioned that federal infrastructure","grants covering up to twenty percent of qualifying water projects open for applications next","spring, though awards are competitive and would delay the start by at least eight months either way.","Question: Write a balanced recommendation memo to the town council. Weigh both options against","the four criteria the mayor listed, account for the grant opportunity, and end with a clear","recommendation and two conditions under which the council should switch to the other option."].join(" "),X=128,_=16,he=[{id:"chat-pp128-tg128",kind:"llm-generate",label:"Chat pp128/tg128",prompt:Oe,approxPromptTokens:128,maxTokens:X,temperature:0},{id:"chat-pp512-tg128",kind:"llm-generate",label:"Long-context pp512/tg128",prompt:Ue,approxPromptTokens:512,maxTokens:X,temperature:0}];function Fe(){let e=["the maintenance schedule for a fleet of electric delivery vans in a coastal city","a beginner guide to fermenting vegetables safely at home in small batches","the migration patterns of shorebirds along the Atlantic flyway in autumn","how a public library catalogs and preserves regional oral history recordings","the tradeoffs between timber framing and steel framing for small workshops","a training plan that prepares a new runner for a half marathon in twenty weeks","the way tide pools support diverse life despite extreme daily changes","budgeting practices for a volunteer-run community theater production"],t=[];for(let o=0;o<32;o++){let n=e[o%e.length];t.push(`Document ${o+1}: This passage explains ${n}. It covers the key steps, common mistakes, expected costs, and a short checklist that a careful reader can apply immediately, with concrete numbers where they matter.`);}return t}var me=Fe(),pe=[{id:"embed-single",kind:"embed-single",label:"Embedding single-query latency",texts:[me[0]]},{id:"embed-batch32",kind:"embed-batch",label:"Embedding batch-32 throughput",texts:me}],ge=[{id:"quality-mmlu-25",kind:"quality-mmlu",label:"tinyMMLU fidelity (25 items)",items:25},{id:"quality-mmlu-100",kind:"quality-mmlu",label:"tinyMMLU fidelity (100 items)",items:100},{id:"quality-sts-100",kind:"quality-sts",label:"STS-B Spearman (100 pairs)",items:100}],He=new Map([...he,...pe,...ge].map(e=>[e.id,e])),F=["transformers-webgpu","transformers-wasm","chrome-ai","webllm","mediapipe","litert","wllama"];function J(e){let t=new Map(F.map((o,n)=>[o,n]));return [...e].sort((o,n)=>(t.get(o.model.runtimeId)??F.length)-(t.get(n.model.runtimeId)??F.length))}var ze={quick:{warmupRuns:1,timedRuns:3,cooldownMs:5e3,pressureGate:true,pressureGateTimeoutMs:15e3,measureWarmReload:false,highVarianceCv:.05},standard:{warmupRuns:1,timedRuns:3,cooldownMs:8e3,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05},thorough:{warmupRuns:1,timedRuns:5,cooldownMs:1e4,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05}};var Z={"transformers-webgpu":"estimated","transformers-wasm":"estimated",webllm:"chunk-count",wllama:"estimated",litert:"estimated","chrome-ai":"estimated",mediapipe:"estimated"};function b(){return typeof performance<"u"?performance.now():Date.now()}function ee(e=64){if(typeof performance>"u")return null;let t=[],o=performance.now(),n=0;for(;t.length<e&&n<2e6;){let a=performance.now();a>o&&(t.push(a-o),o=a),n++;}if(t.length===0)return null;let r=Math.min(...t);return Math.round(r*1e3*100)/100}function H(e,t){return new Promise((o,n)=>{if(t?.aborted){n(E());return}let r=setTimeout(()=>{t?.removeEventListener("abort",a),o();},e);function a(){clearTimeout(r),n(E());}t?.addEventListener("abort",a,{once:true});})}function E(){if(typeof DOMException<"u")return new DOMException("Aborted","AbortError");let e=new Error("Aborted");return e.name="AbortError",e}var W=class{events=[];disposers=[];hidden=false;lastPressureState;wakeLockSentinel=null;record(t,o){this.events.push({t:b(),type:t,...o!==void 0?{detail:o}:{}});}get isHidden(){return this.hidden}get pressureState(){return this.lastPressureState}get all(){return this.events}async attach(){if(typeof document<"u"){let n=()=>{this.hidden=document.visibilityState==="hidden",this.record(this.hidden?"visibility-hidden":"visibility-visible");};document.addEventListener("visibilitychange",n),this.disposers.push(()=>document.removeEventListener("visibilitychange",n)),this.hidden=document.visibilityState==="hidden";}let t=globalThis.PressureObserver;if(t)try{let n=new t(r=>{let a=r[r.length-1];a&&(this.lastPressureState=a.state,this.record("pressure-change",a.state));});await n.observe("cpu",{sampleInterval:1e3}),this.disposers.push(()=>n.disconnect());}catch{}let o=typeof navigator<"u"?navigator.wakeLock:void 0;if(o)try{let n=await o.request("screen");this.wakeLockSentinel=n,this.record("wakelock-acquired"),n.addEventListener("release",()=>{this.record("wakelock-released"),this.wakeLockSentinel=null;});}catch{}}async dispose(){for(let t of this.disposers)t();if(this.disposers=[],this.wakeLockSentinel){try{await this.wakeLockSentinel.release();}catch{}this.wakeLockSentinel=null;}}};function z(){return typeof performance<"u"&&"measureUserAgentSpecificMemory"in performance&&typeof crossOriginIsolated<"u"&&crossOriginIsolated?"uaSpecific":typeof performance<"u"&&"memory"in performance&&typeof performance.memory?.usedJSHeapSize=="number"?"legacyHeap":"none"}async function B(e=25e3){let t=z();if(t==="uaSpecific")try{let o=await Promise.race([performance.measureUserAgentSpecificMemory(),new Promise(n=>setTimeout(()=>n(null),e))]);if(o&&typeof o.bytes=="number")return o.bytes}catch{}if(t!=="none"){let o=performance.memory;if(typeof o?.usedJSHeapSize=="number")return o.usedJSHeapSize}return null}var Ve=["maxBufferSize","maxStorageBufferBindingSize","maxUniformBufferBindingSize","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension","maxBindGroups","maxStorageBuffersPerShaderStage","maxTextureDimension2D"];async function te(e){let t=typeof navigator<"u"?navigator:void 0,o=t?.userAgent??"",{browser:n,os:r,uaData:a}=await $e(t),s=await Qe(t),i=Je(),l=await ke(),c=n.source==="ua-ch"?"Blink":be(o);y(()=>{n.engine=c,t?.vendor&&(n.vendor=t.vendor),t&&typeof t.webdriver=="boolean"&&(n.webdriver=t.webdriver),t&&"pdfViewerEnabled"in t&&(n.pdfViewerEnabled=!!t.pdfViewerEnabled),t?.platform&&(r.navigatorPlatform=t.platform);});let u=et(),d=tt();return {capturedAt:new Date().toISOString(),browser:n,os:r,hardware:{cores:t?.hardwareConcurrency??null,coresClamped:c!=="Blink",deviceMemoryGB:t&&"deviceMemory"in t?t.deviceMemory??null:null,deviceMemoryCapped:true,jsHeapSizeLimitBytes:u?.limit,jsHeapUsedBytes:u?.used},gpu:s,webglRenderer:i?.renderer??null,webgl:i??void 0,gpuModel:we(s,i?.renderer??null),flags:{crossOriginIsolated:typeof crossOriginIsolated<"u"?crossOriginIsolated:false,sharedArrayBuffer:typeof SharedArrayBuffer<"u",wasmSimd:l.simd,secureContext:typeof isSecureContext<"u"?isSecureContext:void 0,wasm:l},apis:await Ze(t,s.available,i?.contextKind==="webgl2"),device:Ye(t,o,a),storage:await rt(t),power:await at(t),pressure:{supported:typeof globalThis<"u"&&"PressureObserver"in globalThis},timerResolutionUs:ee(),screen:d?{width:d.width,height:d.height,dpr:d.dpr}:null,display:d??void 0,network:nt(t),locale:ot(),languages:t?.languages?[...t.languages].slice(0,3):void 0,userAgent:o||void 0,pageOrigin:y(()=>typeof location<"u"?location.origin:void 0),visibilityState:y(()=>typeof document<"u"?document.visibilityState:void 0),userReportedDevice:e?.userReportedDevice}}function y(e){try{return e()}catch{return}}async function $e(e){let t=e&&"userAgentData"in e?e.userAgentData:void 0;if(t)try{let n=await t.getHighEntropyValues(["platform","platformVersion","architecture","bitness","model","fullVersionList","wow64","formFactors"]),r=n.fullVersionList??t.brands??[],a=r.find(s=>!/not.?a.?brand/i.test(s.brand)&&s.brand!=="Chromium")??r.find(s=>!/not.?a.?brand/i.test(s.brand));return {browser:{name:a?.brand??"Chromium",version:a?.version??"unknown",source:"ua-ch",brands:r.map(s=>({brand:s.brand,version:s.version}))},os:{platform:String(n.platform??"unknown"),version:String(n.platformVersion??"unknown"),architecture:n.architecture?String(n.architecture):void 0,bitness:n.bitness?String(n.bitness):void 0,model:n.model?String(n.model):void 0,wow64:typeof n.wow64=="boolean"?n.wow64:void 0},uaData:Object.assign(t,{formFactorsHint:Array.isArray(n.formFactors)?n.formFactors:void 0})}}catch{}let o=e?.userAgent??"";return {...fe(o),uaData:t}}function fe(e){return {browser:Ge(e),os:Ke(e)}}function Ge(e){let t=[["Firefox iOS",/FxiOS\/(\d+[\d.]*)/],["Firefox",/Firefox\/(\d+[\d.]*)/],["Edge",/Edg(?:e|A|iOS)?\/(\d+[\d.]*)/],["Chrome iOS",/CriOS\/(\d+[\d.]*)/],["Safari",/Version\/(\d+[\d.]*).*Safari/],["Chrome",/Chrome\/(\d+[\d.]*)/]];for(let[o,n]of t){let r=e.match(n);if(r)return {name:o,version:r[1],source:"ua-parse"}}return {name:"unknown",version:"unknown",source:"ua-parse"}}function Ke(e){let t="unknown";if(/Windows/.test(e)?t="Windows":/iPhone|iPad|iPod/.test(e)?t="iOS":/Mac OS X/.test(e)?t="macOS":/Android/.test(e)?t="Android":/CrOS/.test(e)?t="Chrome OS":/Linux/.test(e)&&(t="Linux"),t==="iOS"){let o=e.match(/OS (\d+(?:[_.]\d+)*) like Mac OS X/);if(o)return {platform:t,version:o[1].replace(/_/g,".")}}return {platform:t,version:"unknown-frozen"}}function be(e){return e?/iPhone|iPad|iPod/.test(e)?"WebKit":/Gecko\/\d|Firefox\//.test(e)&&!/like Gecko/.test(e)?"Gecko":/Chrome\/|Chromium\/|Edg\//.test(e)?"Blink":/AppleWebKit\//.test(e)?"WebKit":"unknown":"unknown"}function ye(e){let{ua:t,maxTouchPoints:o,formFactors:n,mobile:r}=e;if(n&&n.length>0){let a=new Set(n.map(s=>s.toLowerCase()));if(a.has("xr"))return "xr";if(a.has("automotive")||a.has("tv"))return "tv";if(a.has("tablet"))return "tablet";if(a.has("mobile")||a.has("watch"))return "phone";if(a.has("desktop")||a.has("eink"))return "desktop"}return /iPad/.test(t)?"tablet":/iPhone|iPod/.test(t)?"phone":/Macintosh/.test(t)&&o>1?"tablet":/Android/.test(t)?/Mobile/.test(t)?"phone":"tablet":/CrKey|SmartTV|Tizen|Web0S|BRAVIA|AppleTV/i.test(t)?"tv":/Quest|OculusBrowser|VR\b|XR\b/i.test(t)?"xr":r===true?"phone":/Windows|Macintosh|Linux|CrOS/.test(t)?"desktop":"unknown"}function Ye(e,t,o){if(e)return y(()=>{let n=typeof e.maxTouchPoints=="number"?e.maxTouchPoints:0,r=o?.formFactorsHint,a=o?.mobile,s=ye({ua:t,maxTouchPoints:n,formFactors:r,mobile:a}),i=c=>typeof matchMedia=="function"?y(()=>matchMedia(c).matches):void 0,l=["fullscreen","standalone","minimal-ui","browser"].find(c=>i(`(display-mode: ${c})`)===!0);return {type:s,mobile:a??(s==="phone"||s==="tablet"),formFactors:r,maxTouchPoints:n,pointerCoarse:i("(pointer: coarse)"),hoverNone:i("(hover: none)"),displayMode:l}})}async function Qe(e){let t=e&&"gpu"in e?e.gpu:void 0;if(!t)return {available:false};try{let o=await Promise.race([t.requestAdapter(),new Promise(s=>setTimeout(()=>s(null),3e3))]);if(!o)return {available:!1};let n=o.info??{},r={},a=o.limits;if(a)for(let s of Ve){let i=a[s];typeof i=="number"&&(r[s]=i);}return {available:!0,vendor:v(n.vendor),architecture:v(n.architecture),device:v(n.device),description:v(n.description),subgroupMinSize:k(n.subgroupMinSize),subgroupMaxSize:k(n.subgroupMaxSize),isFallbackAdapter:typeof n.isFallbackAdapter=="boolean"?n.isFallbackAdapter:void 0,features:o.features?[...o.features].sort():void 0,limits:r,preferredCanvasFormat:y(()=>t.getPreferredCanvasFormat?.()),wgslLanguageFeatures:y(()=>t.wgslLanguageFeatures?[...t.wgslLanguageFeatures].sort():void 0)}}catch{return {available:false}}}function v(e){return typeof e=="string"&&e.length>0?e:void 0}function k(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}var Xe=/swiftshader|llvmpipe|softpipe|software|mesa offscreen|microsoft basic render/i;function Je(){try{if(typeof document>"u")return null;let e=document.createElement("canvas"),t="webgl2",o=e.getContext("webgl2");if(o||(t="webgl",o=e.getContext("webgl")),!o)return {contextKind:null};let n=o.getExtension("WEBGL_debug_renderer_info"),r=n?o.getParameter(n.UNMASKED_VENDOR_WEBGL):o.getParameter(o.VENDOR),a=n?o.getParameter(n.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),s={contextKind:t,vendor:v(r),renderer:v(a),version:v(o.getParameter(o.VERSION)),shadingLanguageVersion:v(o.getParameter(o.SHADING_LANGUAGE_VERSION)),maxTextureSize:k(o.getParameter(o.MAX_TEXTURE_SIZE)),maxRenderbufferSize:k(o.getParameter(o.MAX_RENDERBUFFER_SIZE)),maxVertexUniformVectors:k(o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS)),maxFragmentUniformVectors:k(o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS)),extensionCount:y(()=>o.getSupportedExtensions()?.length),softwareRenderer:typeof a=="string"?Xe.test(a):void 0};return y(()=>o.getExtension("WEBGL_lose_context")?.loseContext()),s}catch{return null}}function we(e,t){let o=e.description?.trim();if(o){let n=o.toLowerCase();if(!(n===e.vendor?.toLowerCase()||n===e.architecture?.toLowerCase()))return o}return ve(t)}function ve(e){if(!e)return;let t=e.match(/^ANGLE \((.*)\)$/);if(!t)return e.trim()||void 0;let o=t[1],n=[],r=0,a="";for(let i of o)i==="("&&r++,i===")"&&r--,i===","&&r===0?(n.push(a.trim()),a=""):a+=i;n.push(a.trim());let s=n.length>=2?n[1]:n[0];return s=s.replace(/^ANGLE Metal Renderer:\s*/i,""),s=s.replace(/\s*\(0x[0-9a-fA-F]+\)/g,"").replace(/\s+Direct3D\d+.*$/i,"").trim(),s||void 0}async function ke(){let e=s=>{try{return WebAssembly.validate(new Uint8Array(s))}catch{return false}},t=s=>{try{return new WebAssembly.Module(new Uint8Array(s)),!0}catch{return false}},o=s=>{try{return s()}catch{return false}},n=typeof WebAssembly<"u"?WebAssembly:void 0,r=n,a={simd:e([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]),relaxedSimd:e([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,15,1,13,0,65,1,253,15,65,2,253,15,253,128,2,11]),threads:o(()=>(typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))),bulkMemory:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11]),exceptions:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11]),exceptionsFinal:t([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,16,1,14,0,2,105,31,64,1,3,0,0,11,0,11,26,11]),extendedConst:e([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0]),gc:e([0,97,115,109,1,0,0,0,1,5,1,95,1,120,0]),memory64:e([0,97,115,109,1,0,0,0,5,3,1,4,1]),multiMemory:t([0,97,115,109,1,0,0,0,5,5,2,0,0,0,0]),multiValue:e([0,97,115,109,1,0,0,0,1,6,1,96,0,2,127,127,3,2,1,0,10,8,1,6,0,65,0,65,0,11]),mutableGlobals:e([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1]),referenceTypes:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11]),saturatedFloatToInt:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11]),signExtensions:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11]),tailCall:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,6,1,4,0,18,0,11]),typedFunctionReferences:t([0,97,115,109,1,0,0,0,1,16,3,96,1,127,1,127,96,1,100,0,1,127,96,0,1,127,3,4,3,1,0,2,9,5,1,3,0,1,1,10,28,3,11,0,65,10,65,42,32,0,20,0,106,11,7,0,32,0,65,1,106,11,6,0,210,1,16,0,11]),wideArithmetic:e([0,97,115,109,1,0,0,0,1,10,1,96,4,126,126,126,126,2,126,126,3,2,1,0,10,14,1,12,0,32,0,32,1,32,2,32,3,252,19,11]),jspi:o(()=>!!(r&&"Suspending"in r)),typeReflection:o(()=>!!(r&&"Function"in r)),streamingCompilation:o(()=>!!(r&&typeof r.compileStreaming=="function")),jsStringBuiltins:false};a.jsStringBuiltins=await(async()=>{try{if(!n)return !1;let s=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,111,1,127,2,23,1,14,119,97,115,109,58,106,115,45,115,116,114,105,110,103,4,116,101,115,116,0,0]);return await n.instantiate(s,{},{builtins:["js-string"]}),!0}catch{return false}})();for(let s of [65536,32768,16384])try{new WebAssembly.Memory({initial:1,maximum:s}),a.maxMemoryPages=s;break}catch{}return a}async function Ze(e,t,o){if(!e)return;let n=globalThis,r=e,a=(c,u)=>y(()=>!!(c&&u in c))??false,s=await(async()=>{try{let c=e.storage;return c?.getDirectory?(await c.getDirectory(),!0):!1}catch{return false}})(),i=await(async()=>{try{let c=e.storage;return c?.persisted?await c.persisted():void 0}catch{return}})(),l=async c=>{try{let u=n[c];return u?.availability?await Promise.race([u.availability(),new Promise(d=>setTimeout(()=>d("timeout"),2e3))]):void 0}catch{return "error"}};return {webgpu:t,webgl2:o,webnn:a(r,"ml"),opfs:s,persistedStorage:i,indexedDB:a(n,"indexedDB"),cacheApi:a(n,"caches"),serviceWorker:a(r,"serviceWorker"),webWorkers:a(n,"Worker"),offscreenCanvas:a(n,"OffscreenCanvas"),webLocks:a(r,"locks"),broadcastChannel:a(n,"BroadcastChannel"),wakeLock:a(r,"wakeLock"),computePressure:a(n,"PressureObserver"),performanceMemory:a(typeof performance<"u"?performance:void 0,"memory"),measureUserAgentSpecificMemory:a(typeof performance<"u"?performance:void 0,"measureUserAgentSpecificMemory"),schedulerYield:a(n.scheduler,"yield"),webCodecs:a(n,"VideoDecoder"),audioWorklet:a(n,"AudioWorklet"),mediaDevices:a(r,"mediaDevices"),webTransport:a(n,"WebTransport"),promptApi:await l("LanguageModel"),summarizerApi:await l("Summarizer"),translatorApi:await(async()=>{try{let c=n.Translator;return c?.availability?await Promise.race([c.availability({sourceLanguage:"en",targetLanguage:"es"}),new Promise(u=>setTimeout(()=>u("timeout"),2e3))]):void 0}catch{return "error"}})(),languageDetectorApi:await l("LanguageDetector")}}function et(){return y(()=>{let e=performance.memory;if(e)return {limit:k(e.jsHeapSizeLimit),used:k(e.usedJSHeapSize)}})}function tt(){if(typeof screen>"u")return null;try{let e=o=>typeof matchMedia=="function"?y(()=>matchMedia(o).matches):void 0,t=e("(prefers-color-scheme: dark)")?"dark":e("(prefers-color-scheme: light)")?"light":"no-preference";return {width:screen.width,height:screen.height,availWidth:k(screen.availWidth),availHeight:k(screen.availHeight),dpr:typeof devicePixelRatio<"u"?devicePixelRatio:1,colorDepth:k(screen.colorDepth),orientation:y(()=>screen.orientation?.type),viewportWidth:typeof innerWidth<"u"?innerWidth:void 0,viewportHeight:typeof innerHeight<"u"?innerHeight:void 0,hdr:e("(dynamic-range: high)"),wideGamut:e("(color-gamut: p3)"),isExtended:y(()=>screen.isExtended),prefersReducedMotion:e("(prefers-reduced-motion: reduce)"),prefersColorScheme:t}}catch{return null}}function nt(e){if(e)return y(()=>{let t=e.connection,o=typeof e.onLine=="boolean"?e.onLine:void 0;return t?{supported:!0,effectiveType:v(t.effectiveType),type:v(t.type),downlinkMbps:k(t.downlink),rttMs:k(t.rtt),saveData:typeof t.saveData=="boolean"?t.saveData:void 0,online:o}:{supported:!1,online:o}})}function ot(){return y(()=>{let e=Intl.DateTimeFormat().resolvedOptions();return {timeZone:v(e.timeZone),timeZoneOffsetMinutes:new Date().getTimezoneOffset(),locale:v(e.locale),calendar:v(e.calendar)}})}async function rt(e){try{if(!e?.storage?.estimate)return null;let t=await e.storage.estimate(),o=t.usageDetails;return {quotaBytes:t.quota??void 0,usageBytes:t.usage??void 0,usageDetails:o&&Object.keys(o).length>0?{...o}:void 0}}catch{return null}}async function at(e){try{let t=e&&"getBattery"in e?e.getBattery:void 0;if(!t)return {batterySupported:!1};let o=await t.call(e),n=r=>typeof r=="number"&&Number.isFinite(r)?r:void 0;return {batterySupported:!0,charging:o.charging,level:o.level,chargingTimeSec:n(o.chargingTime),dischargingTimeSec:n(o.dischargingTime)}}catch{return {batterySupported:false}}}function st(e){let t=e>>>0;return ()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967295)}async function ne(e){let t=e?.n??160,o=e?.minDurationMs??600,n=st(780228),r=new Float32Array(t*t),a=new Float32Array(t*t);for(let g=0;g<t*t;g++)r[g]=n()-.5,a[g]=n()-.5;let s=new Float32Array(t*t),i=2*t*t*t,l=0,c=b(),u=0;for(;u<o;)it(r,a,s,t),l++,u=b()-c,l%4===0&&await Promise.resolve();let d=0;for(let g=0;g<t*t;g+=97)d+=s[g];return {mflops:i*l/(u*1e3),n:t,iterations:l,durationMs:u,checksum:Math.fround(d)}}function it(e,t,o,n){for(let r=0;r<n;r++)for(let a=0;a<n;a++){let s=0;for(let i=0;i<n;i++)s+=e[r*n+i]*t[i*n+a];o[r*n+a]=s;}}var Se=[12.706,4.303,3.182,2.776,2.571,2.447,2.365,2.306,2.262,2.228,2.201,2.179,2.16,2.145,2.131,2.12,2.11,2.101,2.093,2.086,2.08,2.074,2.069,2.064,2.06,2.056,2.052,2.048,2.045,2.042];function Ie(e){return [...e].sort((t,o)=>t-o)}function V(e,t){if(e.length===0)throw new RangeError("quantile() requires a non-empty sample");if(t<0||t>1)throw new RangeError(`quantile q must be in [0,1], got ${t}`);let o=Ie(e),n=(o.length-1)*t,r=Math.floor(n),a=Math.ceil(n);return r===a?o[r]:o[r]+(o[a]-o[r])*(n-r)}function $(e){return V(e,.5)}function N(e){if(e.length===0)throw new RangeError("mean() requires a non-empty sample");let t=0;for(let o of e)t+=o;return t/e.length}function xe(e){if(e.length<2)return 0;let t=N(e),o=0;for(let n of e)o+=(n-t)*(n-t);return Math.sqrt(o/(e.length-1))}function lt(e){if(e.length===0)throw new RangeError("geomean() requires a non-empty sample");let t=0;for(let o of e){if(o<=0)throw new RangeError(`geomean() requires positive values, got ${o}`);t+=Math.log(o);}return Math.exp(t/e.length)}function A(e){if(e.length===0)throw new RangeError("summarize() requires a non-empty sample");let t=e.length,o=N(e),n=xe(e),r=Ie(e),a=t>=2?Se[Math.min(t-2,Se.length-1)]*n/Math.sqrt(t):0;return {n:t,median:$(e),mean:o,sd:n,iqr:V(e,.75)-V(e,.25),min:r[0],max:r[t-1],ci95:a,cv:o===0?0:n/Math.abs(o)}}function oe(e,t){if(e.length!==t.length)throw new RangeError("spearman() requires equal-length samples");if(e.length<2)throw new RangeError("spearman() requires n >= 2");let o=Ae(e),n=Ae(t);return ct(o,n)}function Ae(e){let t=e.map((r,a)=>[r,a]).sort((r,a)=>r[0]-a[0]),o=new Array(e.length),n=0;for(;n<t.length;){let r=n;for(;r+1<t.length&&t[r+1][0]===t[n][0];)r++;let a=(n+r)/2+1;for(let s=n;s<=r;s++)o[t[s][1]]=a;n=r+1;}return o}function ct(e,t){let o=N(e),n=N(t),r=0,a=0,s=0;for(let l=0;l<e.length;l++){let c=e[l]-o,u=t[l]-n;r+=c*u,a+=c*c,s+=u*u;}let i=Math.sqrt(a*s);return i===0?0:r/i}var D=[{question:"The number of days it takes to build a new house has a variance of 386. A sample of 40 new homes shows an average building time of 83 days. With what confidence can we assert that the average building time for a new house is between 80 and 90 days?",subject:"high_school_statistics",choices:["15.4%","17.8%","20.0%","82.1%"],answer:3},{question:"According to trials on diabetes prevention, high-risk individuals can reduce their risk to develop diabetes by doing the following:",subject:"nutrition",choices:["Eating a very low carbohydrate diet","Consuming a diet high in monounsaturated fats","Losing 5-7% of body weight through a hypocaloric low fat diet and 30 minutes of daily activity","Initiating metformin 850 mg BID and practicing daily vigorous exercise"],answer:2},{question:"Which of the following is true regarding the complications of a large goitre?",subject:"clinical_knowledge",choices:["It causes stridor due to compression of the oesophagus","Dysphagia is an indication for surgery","It causes hoarseness due to compression of the trachea","It causes a more florid thyrotoxicosis than a smaller goitre"],answer:1},{question:"Doses of substances used in animal toxicity studies are usually many times greater than those experienced by people because:",subject:"nutrition",choices:["Animals are generally much less sensitive than people","Such tests can detect only very large risks because of the fact that only small numbers of animals can be used","It is difficult in such studies to determine whether the observed toxic effects were caused by the substance","It is the only way to ensure results are applicable to people"],answer:1},{question:"Rowena can paint a room in $14$ hours, while Ruby can paint it in $6$ hours. If Rowena paints for $x$ hours and Ruby paints for $y$ hours, they will finish half of the painting, while if Rowena paints for $y$ hours and Ruby paints for $x$ hours they will paint the whole room. Find the ordered pair $(x,y)$.",subject:"high_school_mathematics",choices:["(\\frac{11}{10}, \\frac{11}{10})","(\\frac{231}{20}, \\frac{21}{20})","(\\frac{231}{40}, \\frac{21}{40})","(1,1)"],answer:2},{question:"Which of the following statements would Macedo disagree with?",subject:"moral_disputes",choices:["States should give special weight to their own citizens.","Immigration policies can have powerful economic effects.","Self-governance is morally irrelevant to the immigration debate.","There are reasons to think U.S. immigration policy has had detrimental effects on income distribution among citizens."],answer:2},{question:"A 17-year-old girl is brought to the physician by her mother because she has not had a menstrual period for 6 months. The patient is unconcerned about the lack of menses. Menarche occurred at the age of 12 years, and menses had occurred at regular 28-day intervals until they became irregular 1 year ago. She is a member of her high school gymnastics team. She appears emaciated. She is 163 cm (5 ft 4 in) tall and weighs 40 kg (88 lb); BMI is 15 kg/m2 . Her pulse is 54/min, and blood pressure is 80/50 mm Hg. Which of the following is the most likely cause of this patient's amenorrhea?",subject:"professional_medicine",choices:["Hyperthyroidism","Hypogonadotropic hypogonadism","Hypothyroidism","Polycystic ovarian syndrome"],answer:1},{question:"The Yang-shao culture gave way to the Lung-Shan sometime after:",subject:"prehistory",choices:["6,000 B.P.","5,000 B.P.","4,000 B.P.","3,000 B.P."],answer:1},{question:"Cultural homogenization.",subject:"business_ethics",choices:["1,3,4","1,2,3","1,2,3,4","2,3,4"],answer:1},{question:"Of the ways of escaping moral arguments that he discusses, Hare claims:",subject:"philosophy",choices:["none of them are successful.","some, but not all of them are successful.","all are entirely successful.","all might be successful, but at a price."],answer:3},{question:"An employee of large manufacturing firm finds the work dull, and pursues the job only for the money. The employee performs minimally, and is not motivated so produce highest quantity or better quality. According to F. Herzberg's two-factor theory, the best way 10 increase this worker's self-motivation would be to",subject:"professional_psychology",choices:["offer a raise and incentive pay for greater productivity","redesign the job to provide a challenge and a sense of accomplishment","increase opportunities for informed social interaction","provide the employee with a job tide carrying greater prestige"],answer:1},{question:"In an e-commerce environment that requires that the information technology (IT) system be available on a continuous basis, more emphasis will be placed on which of the following aspects of the planning than in a traditional organization?",subject:"professional_accounting",choices:["Maintain appropriate written source documents so the data can be re-entered if it is lost or compromised","Maintain redundant systems for instant availability to assure the flow of transactions","Review additional expenses to obtain the required amount of business interruption insurance coverage for the organization","Assure that appropriate data backups are stored in an off-site location"],answer:1},{question:"The Space Shuttle orbits 300 km above the Earth\u2019s surface; the Earth\u2019s radius is 6400 km. What is the acceleration due to Earth\u2019s gravity experienced by the Space Shuttle?",subject:"high_school_physics",choices:["4.9 m/s^2","8.9 m/s^2","9.8 m/s^2","10.8 m/s^2"],answer:1},{question:"Statement 1 | The image of a group of 6 elements under a homomorphism may have 12 elements. Statement 2 | There is a homomorphism of some group of 6 elements into some group of 12 elements.",subject:"abstract_algebra",choices:["True, True","False, False","True, False","False, True"],answer:3},{question:"At which of the following locations does bile enter the digestive tract?",subject:"anatomy",choices:["Gastroesophageal sphincter","Duodenum","Ileocecum","Jejunum"],answer:1},{question:`This question refers to the following information.
1
+ var C="localmode-bench/2",L=2;var Oe=["You are helping a small public library plan its move to a new building across town.","The collection holds forty thousand books, two thousand audio recordings, and a local","history archive that must stay in labeled order. Volunteers are available on weekends","only, and the budget covers one rental truck. Describe a practical week-by-week moving","plan that keeps the library partially open, protects the archive, and finishes within","eight weeks. Be specific about labeling, sequencing, and volunteer coordination."].join(" "),Ue=["Read the following notes from a town planning meeting and then answer the question at the end.","The town of Milbrook has grown from eight thousand residents to eleven thousand in six years.","The old water treatment plant, built fifty years ago, operates at ninety two percent of its","rated capacity during summer months. An engineering survey found that the intake pipes show","corrosion consistent with their age but no immediate risk of failure. Replacing the plant","entirely would cost an estimated thirty one million dollars and take four years, during which","a temporary treatment module would be rented at two hundred thousand dollars per month.","Upgrading the existing plant in three phases would cost nineteen million dollars, take six","years, and raise capacity by forty percent, but phase two requires shutting one of the three","treatment trains for nine months. The town engineer favors the upgrade because the town can","fund it from reserves plus a small bond, avoiding a rate increase larger than four percent.","The finance director notes that construction costs have risen eleven percent in two years and","argues that delaying the full replacement will only make it more expensive, and that a larger","bond issued now at current rates would cost less over thirty years than a later one. Several","residents raised concerns about summer watering restrictions during phase two, and a local","manufacturer that employs three hundred people said an unreliable water supply would force it","to install its own storage tanks at significant cost. The mayor asked both officials to prepare","a comparison covering total cost of ownership over thirty years, resilience during construction,","capacity margins in the final state, and the effect on household water rates under three growth","scenarios: flat, moderate, and rapid. The engineer also mentioned that federal infrastructure","grants covering up to twenty percent of qualifying water projects open for applications next","spring, though awards are competitive and would delay the start by at least eight months either way.","Question: Write a balanced recommendation memo to the town council. Weigh both options against","the four criteria the mayor listed, account for the grant opportunity, and end with a clear","recommendation and two conditions under which the council should switch to the other option."].join(" "),X=128,_=16,he=[{id:"chat-pp128-tg128",kind:"llm-generate",label:"Chat pp128/tg128",prompt:Oe,approxPromptTokens:128,maxTokens:X,temperature:0},{id:"chat-pp512-tg128",kind:"llm-generate",label:"Long-context pp512/tg128",prompt:Ue,approxPromptTokens:512,maxTokens:X,temperature:0}];function Fe(){let e=["the maintenance schedule for a fleet of electric delivery vans in a coastal city","a beginner guide to fermenting vegetables safely at home in small batches","the migration patterns of shorebirds along the Atlantic flyway in autumn","how a public library catalogs and preserves regional oral history recordings","the tradeoffs between timber framing and steel framing for small workshops","a training plan that prepares a new runner for a half marathon in twenty weeks","the way tide pools support diverse life despite extreme daily changes","budgeting practices for a volunteer-run community theater production"],t=[];for(let n=0;n<32;n++){let o=e[n%e.length];t.push(`Document ${n+1}: This passage explains ${o}. It covers the key steps, common mistakes, expected costs, and a short checklist that a careful reader can apply immediately, with concrete numbers where they matter.`);}return t}var me=Fe(),pe=[{id:"embed-single",kind:"embed-single",label:"Embedding single-query latency",texts:[me[0]]},{id:"embed-batch32",kind:"embed-batch",label:"Embedding batch-32 throughput",texts:me}],ge=[{id:"quality-mmlu-25",kind:"quality-mmlu",label:"tinyMMLU fidelity (25 items)",items:25},{id:"quality-mmlu-100",kind:"quality-mmlu",label:"tinyMMLU fidelity (100 items)",items:100},{id:"quality-sts-100",kind:"quality-sts",label:"STS-B Spearman (100 pairs)",items:100}],He=new Map([...he,...pe,...ge].map(e=>[e.id,e])),F=["transformers-webgpu","transformers-wasm","chrome-ai","webllm","mediapipe","litert","wllama"];function J(e){let t=new Map(F.map((n,o)=>[n,o]));return [...e].sort((n,o)=>(t.get(n.model.runtimeId)??F.length)-(t.get(o.model.runtimeId)??F.length))}var ze={quick:{warmupRuns:1,timedRuns:3,cooldownMs:5e3,pressureGate:true,pressureGateTimeoutMs:15e3,measureWarmReload:false,highVarianceCv:.05},standard:{warmupRuns:1,timedRuns:3,cooldownMs:8e3,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05},thorough:{warmupRuns:1,timedRuns:5,cooldownMs:1e4,pressureGate:true,pressureGateTimeoutMs:3e4,measureWarmReload:true,highVarianceCv:.05}};var Z={"transformers-webgpu":"estimated","transformers-wasm":"estimated",webllm:"chunk-count",wllama:"estimated",litert:"estimated","chrome-ai":"estimated",mediapipe:"estimated"};function b(){return typeof performance<"u"?performance.now():Date.now()}function ee(e=64){if(typeof performance>"u")return null;let t=[],n=performance.now(),o=0;for(;t.length<e&&o<2e6;){let a=performance.now();a>n&&(t.push(a-n),n=a),o++;}if(t.length===0)return null;let r=Math.min(...t);return Math.round(r*1e3*100)/100}function H(e,t){return new Promise((n,o)=>{if(t?.aborted){o(E());return}let r=setTimeout(()=>{t?.removeEventListener("abort",a),n();},e);function a(){clearTimeout(r),o(E());}t?.addEventListener("abort",a,{once:true});})}function E(){if(typeof DOMException<"u")return new DOMException("Aborted","AbortError");let e=new Error("Aborted");return e.name="AbortError",e}var N=class{events=[];disposers=[];hidden=false;lastPressureState;wakeLockSentinel=null;record(t,n){this.events.push({t:b(),type:t,...n!==void 0?{detail:n}:{}});}get isHidden(){return this.hidden}get pressureState(){return this.lastPressureState}get all(){return this.events}async attach(){if(typeof document<"u"){let o=()=>{this.hidden=document.visibilityState==="hidden",this.record(this.hidden?"visibility-hidden":"visibility-visible");};document.addEventListener("visibilitychange",o),this.disposers.push(()=>document.removeEventListener("visibilitychange",o)),this.hidden=document.visibilityState==="hidden";}let t=globalThis.PressureObserver;if(t)try{let o=new t(r=>{let a=r[r.length-1];if(a){let s=a.state!==this.lastPressureState;this.lastPressureState=a.state,s&&this.record("pressure-change",a.state);}});await o.observe("cpu",{sampleInterval:1e3}),this.disposers.push(()=>o.disconnect());}catch{}let n=typeof navigator<"u"?navigator.wakeLock:void 0;if(n)try{let o=await n.request("screen");this.wakeLockSentinel=o,this.record("wakelock-acquired"),o.addEventListener("release",()=>{this.record("wakelock-released"),this.wakeLockSentinel=null;});}catch{}}async dispose(){for(let t of this.disposers)t();if(this.disposers=[],this.wakeLockSentinel){try{await this.wakeLockSentinel.release();}catch{}this.wakeLockSentinel=null;}}};function z(){return typeof performance<"u"&&"measureUserAgentSpecificMemory"in performance&&typeof crossOriginIsolated<"u"&&crossOriginIsolated?"uaSpecific":typeof performance<"u"&&"memory"in performance&&typeof performance.memory?.usedJSHeapSize=="number"?"legacyHeap":"none"}async function B(e=25e3){let t=z();if(t==="uaSpecific")try{let n=await Promise.race([performance.measureUserAgentSpecificMemory(),new Promise(o=>setTimeout(()=>o(null),e))]);if(n&&typeof n.bytes=="number")return n.bytes}catch{}if(t!=="none"){let n=performance.memory;if(typeof n?.usedJSHeapSize=="number")return n.usedJSHeapSize}return null}var Ve=["maxBufferSize","maxStorageBufferBindingSize","maxUniformBufferBindingSize","maxComputeWorkgroupStorageSize","maxComputeInvocationsPerWorkgroup","maxComputeWorkgroupSizeX","maxComputeWorkgroupSizeY","maxComputeWorkgroupSizeZ","maxComputeWorkgroupsPerDimension","maxBindGroups","maxStorageBuffersPerShaderStage","maxTextureDimension2D"];async function te(e){let t=typeof navigator<"u"?navigator:void 0,n=t?.userAgent??"",{browser:o,os:r,uaData:a}=await $e(t),s=await Qe(t),i=Je(),l=await ke(),c=o.source==="ua-ch"?"Blink":be(n);y(()=>{o.engine=c,t?.vendor&&(o.vendor=t.vendor),t&&typeof t.webdriver=="boolean"&&(o.webdriver=t.webdriver),t&&"pdfViewerEnabled"in t&&(o.pdfViewerEnabled=!!t.pdfViewerEnabled),t?.platform&&(r.navigatorPlatform=t.platform);});let m=et(),d=tt();return {capturedAt:new Date().toISOString(),browser:o,os:r,hardware:{cores:t?.hardwareConcurrency??null,coresClamped:c!=="Blink",deviceMemoryGB:t&&"deviceMemory"in t?t.deviceMemory??null:null,deviceMemoryCapped:true,jsHeapSizeLimitBytes:m?.limit,jsHeapUsedBytes:m?.used},gpu:s,webglRenderer:i?.renderer??null,webgl:i??void 0,gpuModel:we(s,i?.renderer??null),flags:{crossOriginIsolated:typeof crossOriginIsolated<"u"?crossOriginIsolated:false,sharedArrayBuffer:typeof SharedArrayBuffer<"u",wasmSimd:l.simd,secureContext:typeof isSecureContext<"u"?isSecureContext:void 0,wasm:l},apis:await Ze(t,s.available,i?.contextKind==="webgl2"),device:Ye(t,n,a),storage:await rt(t),power:await at(t),pressure:{supported:typeof globalThis<"u"&&"PressureObserver"in globalThis},timerResolutionUs:ee(),screen:d?{width:d.width,height:d.height,dpr:d.dpr}:null,display:d??void 0,network:nt(t),locale:ot(),languages:t?.languages?[...t.languages].slice(0,3):void 0,userAgent:n||void 0,pageOrigin:y(()=>typeof location<"u"?location.origin:void 0),visibilityState:y(()=>typeof document<"u"?document.visibilityState:void 0),userReportedDevice:e?.userReportedDevice}}function y(e){try{return e()}catch{return}}async function $e(e){let t=e&&"userAgentData"in e?e.userAgentData:void 0;if(t)try{let o=await t.getHighEntropyValues(["platform","platformVersion","architecture","bitness","model","fullVersionList","wow64","formFactors"]),r=o.fullVersionList??t.brands??[],a=r.find(s=>!/not.?a.?brand/i.test(s.brand)&&s.brand!=="Chromium")??r.find(s=>!/not.?a.?brand/i.test(s.brand));return {browser:{name:a?.brand??"Chromium",version:a?.version??"unknown",source:"ua-ch",brands:r.map(s=>({brand:s.brand,version:s.version}))},os:{platform:String(o.platform??"unknown"),version:String(o.platformVersion??"unknown"),architecture:o.architecture?String(o.architecture):void 0,bitness:o.bitness?String(o.bitness):void 0,model:o.model?String(o.model):void 0,wow64:typeof o.wow64=="boolean"?o.wow64:void 0},uaData:Object.assign(t,{formFactorsHint:Array.isArray(o.formFactors)?o.formFactors:void 0})}}catch{}let n=e?.userAgent??"";return {...fe(n),uaData:t}}function fe(e){return {browser:Ge(e),os:Ke(e)}}function Ge(e){let t=[["Firefox iOS",/FxiOS\/(\d+[\d.]*)/],["Firefox",/Firefox\/(\d+[\d.]*)/],["Edge",/Edg(?:e|A|iOS)?\/(\d+[\d.]*)/],["Chrome iOS",/CriOS\/(\d+[\d.]*)/],["Safari",/Version\/(\d+[\d.]*).*Safari/],["Chrome",/Chrome\/(\d+[\d.]*)/]];for(let[n,o]of t){let r=e.match(o);if(r)return {name:n,version:r[1],source:"ua-parse"}}return {name:"unknown",version:"unknown",source:"ua-parse"}}function Ke(e){let t="unknown";if(/Windows/.test(e)?t="Windows":/iPhone|iPad|iPod/.test(e)?t="iOS":/Mac OS X/.test(e)?t="macOS":/Android/.test(e)?t="Android":/CrOS/.test(e)?t="Chrome OS":/Linux/.test(e)&&(t="Linux"),t==="iOS"){let n=e.match(/OS (\d+(?:[_.]\d+)*) like Mac OS X/);if(n)return {platform:t,version:n[1].replace(/_/g,".")}}return {platform:t,version:"unknown-frozen"}}function be(e){return e?/iPhone|iPad|iPod/.test(e)?"WebKit":/Gecko\/\d|Firefox\//.test(e)&&!/like Gecko/.test(e)?"Gecko":/Chrome\/|Chromium\/|Edg\//.test(e)?"Blink":/AppleWebKit\//.test(e)?"WebKit":"unknown":"unknown"}function ye(e){let{ua:t,maxTouchPoints:n,formFactors:o,mobile:r}=e;if(o&&o.length>0){let a=new Set(o.map(s=>s.toLowerCase()));if(a.has("xr"))return "xr";if(a.has("automotive")||a.has("tv"))return "tv";if(a.has("tablet"))return "tablet";if(a.has("mobile")||a.has("watch"))return "phone";if(a.has("desktop")||a.has("eink"))return "desktop"}return /iPad/.test(t)?"tablet":/iPhone|iPod/.test(t)?"phone":/Macintosh/.test(t)&&n>1?"tablet":/Android/.test(t)?/Mobile/.test(t)?"phone":"tablet":/CrKey|SmartTV|Tizen|Web0S|BRAVIA|AppleTV/i.test(t)?"tv":/Quest|OculusBrowser|VR\b|XR\b/i.test(t)?"xr":r===true?"phone":/Windows|Macintosh|Linux|CrOS/.test(t)?"desktop":"unknown"}function Ye(e,t,n){if(e)return y(()=>{let o=typeof e.maxTouchPoints=="number"?e.maxTouchPoints:0,r=n?.formFactorsHint,a=n?.mobile,s=ye({ua:t,maxTouchPoints:o,formFactors:r,mobile:a}),i=c=>typeof matchMedia=="function"?y(()=>matchMedia(c).matches):void 0,l=["fullscreen","standalone","minimal-ui","browser"].find(c=>i(`(display-mode: ${c})`)===!0);return {type:s,mobile:a??(s==="phone"||s==="tablet"),formFactors:r,maxTouchPoints:o,pointerCoarse:i("(pointer: coarse)"),hoverNone:i("(hover: none)"),displayMode:l}})}async function Qe(e){let t=e&&"gpu"in e?e.gpu:void 0;if(!t)return {available:false};try{let n=await Promise.race([t.requestAdapter(),new Promise(s=>setTimeout(()=>s(null),3e3))]);if(!n)return {available:!1};let o=n.info??{},r={},a=n.limits;if(a)for(let s of Ve){let i=a[s];typeof i=="number"&&(r[s]=i);}return {available:!0,vendor:v(o.vendor),architecture:v(o.architecture),device:v(o.device),description:v(o.description),subgroupMinSize:k(o.subgroupMinSize),subgroupMaxSize:k(o.subgroupMaxSize),isFallbackAdapter:typeof o.isFallbackAdapter=="boolean"?o.isFallbackAdapter:void 0,features:n.features?[...n.features].sort():void 0,limits:r,preferredCanvasFormat:y(()=>t.getPreferredCanvasFormat?.()),wgslLanguageFeatures:y(()=>t.wgslLanguageFeatures?[...t.wgslLanguageFeatures].sort():void 0)}}catch{return {available:false}}}function v(e){return typeof e=="string"&&e.length>0?e:void 0}function k(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}var Xe=/swiftshader|llvmpipe|softpipe|software|mesa offscreen|microsoft basic render/i;function Je(){try{if(typeof document>"u")return null;let e=document.createElement("canvas"),t="webgl2",n=e.getContext("webgl2");if(n||(t="webgl",n=e.getContext("webgl")),!n)return {contextKind:null};let o=n.getExtension("WEBGL_debug_renderer_info"),r=o?n.getParameter(o.UNMASKED_VENDOR_WEBGL):n.getParameter(n.VENDOR),a=o?n.getParameter(o.UNMASKED_RENDERER_WEBGL):n.getParameter(n.RENDERER),s={contextKind:t,vendor:v(r),renderer:v(a),version:v(n.getParameter(n.VERSION)),shadingLanguageVersion:v(n.getParameter(n.SHADING_LANGUAGE_VERSION)),maxTextureSize:k(n.getParameter(n.MAX_TEXTURE_SIZE)),maxRenderbufferSize:k(n.getParameter(n.MAX_RENDERBUFFER_SIZE)),maxVertexUniformVectors:k(n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS)),maxFragmentUniformVectors:k(n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS)),extensionCount:y(()=>n.getSupportedExtensions()?.length),softwareRenderer:typeof a=="string"?Xe.test(a):void 0};return y(()=>n.getExtension("WEBGL_lose_context")?.loseContext()),s}catch{return null}}function we(e,t){let n=e.description?.trim();if(n){let o=n.toLowerCase();if(!(o===e.vendor?.toLowerCase()||o===e.architecture?.toLowerCase()))return n}return ve(t)}function ve(e){if(!e)return;let t=e.match(/^ANGLE \((.*)\)$/);if(!t)return e.trim()||void 0;let n=t[1],o=[],r=0,a="";for(let i of n)i==="("&&r++,i===")"&&r--,i===","&&r===0?(o.push(a.trim()),a=""):a+=i;o.push(a.trim());let s=o.length>=2?o[1]:o[0];return s=s.replace(/^ANGLE Metal Renderer:\s*/i,""),s=s.replace(/\s*\(0x[0-9a-fA-F]+\)/g,"").replace(/\s+Direct3D\d+.*$/i,"").trim(),s||void 0}async function ke(){let e=s=>{try{return WebAssembly.validate(new Uint8Array(s))}catch{return false}},t=s=>{try{return new WebAssembly.Module(new Uint8Array(s)),!0}catch{return false}},n=s=>{try{return s()}catch{return false}},o=typeof WebAssembly<"u"?WebAssembly:void 0,r=o,a={simd:e([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]),relaxedSimd:e([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,15,1,13,0,65,1,253,15,65,2,253,15,253,128,2,11]),threads:n(()=>(typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))),bulkMemory:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11]),exceptions:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11]),exceptionsFinal:t([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,16,1,14,0,2,105,31,64,1,3,0,0,11,0,11,26,11]),extendedConst:e([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0]),gc:e([0,97,115,109,1,0,0,0,1,5,1,95,1,120,0]),memory64:e([0,97,115,109,1,0,0,0,5,3,1,4,1]),multiMemory:t([0,97,115,109,1,0,0,0,5,5,2,0,0,0,0]),multiValue:e([0,97,115,109,1,0,0,0,1,6,1,96,0,2,127,127,3,2,1,0,10,8,1,6,0,65,0,65,0,11]),mutableGlobals:e([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1]),referenceTypes:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11]),saturatedFloatToInt:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11]),signExtensions:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11]),tailCall:e([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,6,1,4,0,18,0,11]),typedFunctionReferences:t([0,97,115,109,1,0,0,0,1,16,3,96,1,127,1,127,96,1,100,0,1,127,96,0,1,127,3,4,3,1,0,2,9,5,1,3,0,1,1,10,28,3,11,0,65,10,65,42,32,0,20,0,106,11,7,0,32,0,65,1,106,11,6,0,210,1,16,0,11]),wideArithmetic:e([0,97,115,109,1,0,0,0,1,10,1,96,4,126,126,126,126,2,126,126,3,2,1,0,10,14,1,12,0,32,0,32,1,32,2,32,3,252,19,11]),jspi:n(()=>!!(r&&"Suspending"in r)),typeReflection:n(()=>!!(r&&"Function"in r)),streamingCompilation:n(()=>!!(r&&typeof r.compileStreaming=="function")),jsStringBuiltins:false};a.jsStringBuiltins=await(async()=>{try{if(!o)return !1;let s=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,111,1,127,2,23,1,14,119,97,115,109,58,106,115,45,115,116,114,105,110,103,4,116,101,115,116,0,0]);return await o.instantiate(s,{},{builtins:["js-string"]}),!0}catch{return false}})();for(let s of [65536,32768,16384])try{new WebAssembly.Memory({initial:1,maximum:s}),a.maxMemoryPages=s;break}catch{}return a}async function Ze(e,t,n){if(!e)return;let o=globalThis,r=e,a=(c,m)=>y(()=>!!(c&&m in c))??false,s=await(async()=>{try{let c=e.storage;return c?.getDirectory?(await c.getDirectory(),!0):!1}catch{return false}})(),i=await(async()=>{try{let c=e.storage;return c?.persisted?await c.persisted():void 0}catch{return}})(),l=async c=>{try{let m=o[c];return m?.availability?await Promise.race([m.availability(),new Promise(d=>setTimeout(()=>d("timeout"),2e3))]):void 0}catch{return "error"}};return {webgpu:t,webgl2:n,webnn:a(r,"ml"),opfs:s,persistedStorage:i,indexedDB:a(o,"indexedDB"),cacheApi:a(o,"caches"),serviceWorker:a(r,"serviceWorker"),webWorkers:a(o,"Worker"),offscreenCanvas:a(o,"OffscreenCanvas"),webLocks:a(r,"locks"),broadcastChannel:a(o,"BroadcastChannel"),wakeLock:a(r,"wakeLock"),computePressure:a(o,"PressureObserver"),performanceMemory:a(typeof performance<"u"?performance:void 0,"memory"),measureUserAgentSpecificMemory:a(typeof performance<"u"?performance:void 0,"measureUserAgentSpecificMemory"),schedulerYield:a(o.scheduler,"yield"),webCodecs:a(o,"VideoDecoder"),audioWorklet:a(o,"AudioWorklet"),mediaDevices:a(r,"mediaDevices"),webTransport:a(o,"WebTransport"),promptApi:await l("LanguageModel"),summarizerApi:await l("Summarizer"),translatorApi:await(async()=>{try{let c=o.Translator;return c?.availability?await Promise.race([c.availability({sourceLanguage:"en",targetLanguage:"es"}),new Promise(m=>setTimeout(()=>m("timeout"),2e3))]):void 0}catch{return "error"}})(),languageDetectorApi:await l("LanguageDetector")}}function et(){return y(()=>{let e=performance.memory;if(e)return {limit:k(e.jsHeapSizeLimit),used:k(e.usedJSHeapSize)}})}function tt(){if(typeof screen>"u")return null;try{let e=n=>typeof matchMedia=="function"?y(()=>matchMedia(n).matches):void 0,t=e("(prefers-color-scheme: dark)")?"dark":e("(prefers-color-scheme: light)")?"light":"no-preference";return {width:screen.width,height:screen.height,availWidth:k(screen.availWidth),availHeight:k(screen.availHeight),dpr:typeof devicePixelRatio<"u"?devicePixelRatio:1,colorDepth:k(screen.colorDepth),orientation:y(()=>screen.orientation?.type),viewportWidth:typeof innerWidth<"u"?innerWidth:void 0,viewportHeight:typeof innerHeight<"u"?innerHeight:void 0,hdr:e("(dynamic-range: high)"),wideGamut:e("(color-gamut: p3)"),isExtended:y(()=>screen.isExtended),prefersReducedMotion:e("(prefers-reduced-motion: reduce)"),prefersColorScheme:t}}catch{return null}}function nt(e){if(e)return y(()=>{let t=e.connection,n=typeof e.onLine=="boolean"?e.onLine:void 0;return t?{supported:!0,effectiveType:v(t.effectiveType),type:v(t.type),downlinkMbps:k(t.downlink),rttMs:k(t.rtt),saveData:typeof t.saveData=="boolean"?t.saveData:void 0,online:n}:{supported:!1,online:n}})}function ot(){return y(()=>{let e=Intl.DateTimeFormat().resolvedOptions();return {timeZone:v(e.timeZone),timeZoneOffsetMinutes:new Date().getTimezoneOffset(),locale:v(e.locale),calendar:v(e.calendar)}})}async function rt(e){try{if(!e?.storage?.estimate)return null;let t=await e.storage.estimate(),n=t.usageDetails;return {quotaBytes:t.quota??void 0,usageBytes:t.usage??void 0,usageDetails:n&&Object.keys(n).length>0?{...n}:void 0}}catch{return null}}async function at(e){try{let t=e&&"getBattery"in e?e.getBattery:void 0;if(!t)return {batterySupported:!1};let n=await t.call(e),o=r=>typeof r=="number"&&Number.isFinite(r)?r:void 0;return {batterySupported:!0,charging:n.charging,level:n.level,chargingTimeSec:o(n.chargingTime),dischargingTimeSec:o(n.dischargingTime)}}catch{return {batterySupported:false}}}function st(e){let t=e>>>0;return ()=>(t=Math.imul(t,1664525)+1013904223>>>0,t/4294967295)}async function ne(e){let t=e?.n??160,n=e?.minDurationMs??600,o=st(780228),r=new Float32Array(t*t),a=new Float32Array(t*t);for(let g=0;g<t*t;g++)r[g]=o()-.5,a[g]=o()-.5;let s=new Float32Array(t*t),i=2*t*t*t,l=0,c=b(),m=0;for(;m<n;)it(r,a,s,t),l++,m=b()-c,l%4===0&&await Promise.resolve();let d=0;for(let g=0;g<t*t;g+=97)d+=s[g];return {mflops:i*l/(m*1e3),n:t,iterations:l,durationMs:m,checksum:Math.fround(d)}}function it(e,t,n,o){for(let r=0;r<o;r++)for(let a=0;a<o;a++){let s=0;for(let i=0;i<o;i++)s+=e[r*o+i]*t[i*o+a];n[r*o+a]=s;}}var Se=[12.706,4.303,3.182,2.776,2.571,2.447,2.365,2.306,2.262,2.228,2.201,2.179,2.16,2.145,2.131,2.12,2.11,2.101,2.093,2.086,2.08,2.074,2.069,2.064,2.06,2.056,2.052,2.048,2.045,2.042];function Ie(e){return [...e].sort((t,n)=>t-n)}function V(e,t){if(e.length===0)throw new RangeError("quantile() requires a non-empty sample");if(t<0||t>1)throw new RangeError(`quantile q must be in [0,1], got ${t}`);let n=Ie(e),o=(n.length-1)*t,r=Math.floor(o),a=Math.ceil(o);return r===a?n[r]:n[r]+(n[a]-n[r])*(o-r)}function $(e){return V(e,.5)}function D(e){if(e.length===0)throw new RangeError("mean() requires a non-empty sample");let t=0;for(let n of e)t+=n;return t/e.length}function xe(e){if(e.length<2)return 0;let t=D(e),n=0;for(let o of e)n+=(o-t)*(o-t);return Math.sqrt(n/(e.length-1))}function lt(e){if(e.length===0)throw new RangeError("geomean() requires a non-empty sample");let t=0;for(let n of e){if(n<=0)throw new RangeError(`geomean() requires positive values, got ${n}`);t+=Math.log(n);}return Math.exp(t/e.length)}function A(e){if(e.length===0)throw new RangeError("summarize() requires a non-empty sample");let t=e.length,n=D(e),o=xe(e),r=Ie(e),a=t>=2?Se[Math.min(t-2,Se.length-1)]*o/Math.sqrt(t):0;return {n:t,median:$(e),mean:n,sd:o,iqr:V(e,.75)-V(e,.25),min:r[0],max:r[t-1],ci95:a,cv:n===0?0:o/Math.abs(n)}}function oe(e,t){if(e.length!==t.length)throw new RangeError("spearman() requires equal-length samples");if(e.length<2)throw new RangeError("spearman() requires n >= 2");let n=Ae(e),o=Ae(t);return ct(n,o)}function Ae(e){let t=e.map((r,a)=>[r,a]).sort((r,a)=>r[0]-a[0]),n=new Array(e.length),o=0;for(;o<t.length;){let r=o;for(;r+1<t.length&&t[r+1][0]===t[o][0];)r++;let a=(o+r)/2+1;for(let s=o;s<=r;s++)n[t[s][1]]=a;o=r+1;}return n}function ct(e,t){let n=D(e),o=D(t),r=0,a=0,s=0;for(let l=0;l<e.length;l++){let c=e[l]-n,m=t[l]-o;r+=c*m,a+=c*c,s+=m*m;}let i=Math.sqrt(a*s);return i===0?0:r/i}var O=[{question:"The number of days it takes to build a new house has a variance of 386. A sample of 40 new homes shows an average building time of 83 days. With what confidence can we assert that the average building time for a new house is between 80 and 90 days?",subject:"high_school_statistics",choices:["15.4%","17.8%","20.0%","82.1%"],answer:3},{question:"According to trials on diabetes prevention, high-risk individuals can reduce their risk to develop diabetes by doing the following:",subject:"nutrition",choices:["Eating a very low carbohydrate diet","Consuming a diet high in monounsaturated fats","Losing 5-7% of body weight through a hypocaloric low fat diet and 30 minutes of daily activity","Initiating metformin 850 mg BID and practicing daily vigorous exercise"],answer:2},{question:"Which of the following is true regarding the complications of a large goitre?",subject:"clinical_knowledge",choices:["It causes stridor due to compression of the oesophagus","Dysphagia is an indication for surgery","It causes hoarseness due to compression of the trachea","It causes a more florid thyrotoxicosis than a smaller goitre"],answer:1},{question:"Doses of substances used in animal toxicity studies are usually many times greater than those experienced by people because:",subject:"nutrition",choices:["Animals are generally much less sensitive than people","Such tests can detect only very large risks because of the fact that only small numbers of animals can be used","It is difficult in such studies to determine whether the observed toxic effects were caused by the substance","It is the only way to ensure results are applicable to people"],answer:1},{question:"Rowena can paint a room in $14$ hours, while Ruby can paint it in $6$ hours. If Rowena paints for $x$ hours and Ruby paints for $y$ hours, they will finish half of the painting, while if Rowena paints for $y$ hours and Ruby paints for $x$ hours they will paint the whole room. Find the ordered pair $(x,y)$.",subject:"high_school_mathematics",choices:["(\\frac{11}{10}, \\frac{11}{10})","(\\frac{231}{20}, \\frac{21}{20})","(\\frac{231}{40}, \\frac{21}{40})","(1,1)"],answer:2},{question:"Which of the following statements would Macedo disagree with?",subject:"moral_disputes",choices:["States should give special weight to their own citizens.","Immigration policies can have powerful economic effects.","Self-governance is morally irrelevant to the immigration debate.","There are reasons to think U.S. immigration policy has had detrimental effects on income distribution among citizens."],answer:2},{question:"A 17-year-old girl is brought to the physician by her mother because she has not had a menstrual period for 6 months. The patient is unconcerned about the lack of menses. Menarche occurred at the age of 12 years, and menses had occurred at regular 28-day intervals until they became irregular 1 year ago. She is a member of her high school gymnastics team. She appears emaciated. She is 163 cm (5 ft 4 in) tall and weighs 40 kg (88 lb); BMI is 15 kg/m2 . Her pulse is 54/min, and blood pressure is 80/50 mm Hg. Which of the following is the most likely cause of this patient's amenorrhea?",subject:"professional_medicine",choices:["Hyperthyroidism","Hypogonadotropic hypogonadism","Hypothyroidism","Polycystic ovarian syndrome"],answer:1},{question:"The Yang-shao culture gave way to the Lung-Shan sometime after:",subject:"prehistory",choices:["6,000 B.P.","5,000 B.P.","4,000 B.P.","3,000 B.P."],answer:1},{question:"Cultural homogenization.",subject:"business_ethics",choices:["1,3,4","1,2,3","1,2,3,4","2,3,4"],answer:1},{question:"Of the ways of escaping moral arguments that he discusses, Hare claims:",subject:"philosophy",choices:["none of them are successful.","some, but not all of them are successful.","all are entirely successful.","all might be successful, but at a price."],answer:3},{question:"An employee of large manufacturing firm finds the work dull, and pursues the job only for the money. The employee performs minimally, and is not motivated so produce highest quantity or better quality. According to F. Herzberg's two-factor theory, the best way 10 increase this worker's self-motivation would be to",subject:"professional_psychology",choices:["offer a raise and incentive pay for greater productivity","redesign the job to provide a challenge and a sense of accomplishment","increase opportunities for informed social interaction","provide the employee with a job tide carrying greater prestige"],answer:1},{question:"In an e-commerce environment that requires that the information technology (IT) system be available on a continuous basis, more emphasis will be placed on which of the following aspects of the planning than in a traditional organization?",subject:"professional_accounting",choices:["Maintain appropriate written source documents so the data can be re-entered if it is lost or compromised","Maintain redundant systems for instant availability to assure the flow of transactions","Review additional expenses to obtain the required amount of business interruption insurance coverage for the organization","Assure that appropriate data backups are stored in an off-site location"],answer:1},{question:"The Space Shuttle orbits 300 km above the Earth\u2019s surface; the Earth\u2019s radius is 6400 km. What is the acceleration due to Earth\u2019s gravity experienced by the Space Shuttle?",subject:"high_school_physics",choices:["4.9 m/s^2","8.9 m/s^2","9.8 m/s^2","10.8 m/s^2"],answer:1},{question:"Statement 1 | The image of a group of 6 elements under a homomorphism may have 12 elements. Statement 2 | There is a homomorphism of some group of 6 elements into some group of 12 elements.",subject:"abstract_algebra",choices:["True, True","False, False","True, False","False, True"],answer:3},{question:"At which of the following locations does bile enter the digestive tract?",subject:"anatomy",choices:["Gastroesophageal sphincter","Duodenum","Ileocecum","Jejunum"],answer:1},{question:`This question refers to the following information.
2
2
  Is it not unity alone that can weld us into an effective force, capable of creating our own progress and making our valuable contribution to world peace? Which independent African state will claim that its financial structure and banking institutions are fully harnessed to its national development? Which will claim that its material resources and human energies are available for its own national aspirations? We are fast learning that political independence is not enough to rid us of the consequences of colonial rule. We have been too busy nursing our separate states to understand fully the basic need for union, rooted in common purpose, common planning and common endeavour.
3
3
  Ghana's president, Kwame Nkrumah, addressing the Organization of African Unity, 1963
4
4
  The speaker in the passage above is espousing which of the following causes?`,subject:"high_school_world_history",choices:["Nationalism","Socialism","Pan-Africanism","Neocolonialism"],answer:2},{question:"Monte Alban is located in the ________ and was built by the _________.",subject:"prehistory",choices:["Valley of Mexico; Aztec.","Valley of Oaxaca; Zapotec.","Amazon floodplain; Olmec.","Yucat\xE1n Peninsula; Maya."],answer:1},{question:`Sauna use, sometimes referred to as "sauna bathing," is characterized by short-term passive exposure to extreme heat. This exposure elicits mild hyperthermia \u2013 an increase in the body's core temperature \u2013 that induces a thermoregulatory response involving neuroendocrine, cardiovascular, and cytoprotective mechanisms that work together to restore homeostasis and condition the body for future heat stressors\u2026 In recent decades, sauna bathing has emerged as a means to increase lifespan and improve overall health, based on compelling data from observational, interventional, and mechanistic studies. Of particular interest are the findings from studies of participants in the Kuopio Ischemic Heart Disease Risk Factor (KIHD) Study, an ongoing prospective population-based cohort study of health outcomes in more than 2,300 middle-aged men from eastern Finland, which identified strong links between sauna use and reduced death and disease\u2026 The KIHD findings showed that men who used the sauna two to three times per week were 27 percent less likely to die from cardiovascular-related causes than men who didn't use the sauna.[2] Furthermore, the benefits they experienced were found to be dose-dependent: Men who used the sauna roughly twice as often, about four to seven times per week, experienced roughly twice the benefits \u2013 and were 50 percent less likely to die from cardiovascular-related causes.[2] In addition, frequent sauna users were found to be 40 percent less likely to die from all causes of premature death. These findings held true even when considering age, activity levels, and lifestyle factors that might have influenced the men's health.[2]... The KIHD also revealed that frequent sauna use reduced the risk of developing dementia and Alzheimer's disease in a dose-dependent manner. Men who used the sauna two to three times per week had a 66 percent lower risk of developing dementia and a 65 percent lower risk of developing Alzheimer's disease, compared to men who used the sauna only one time per week\u2026 The health benefits associated with sauna use extended to other aspects of mental health, as well. Men participating in the KIHD study who used the sauna four to seven times per week were 77 percent less likely to develop psychotic disorders, regardless of the men's dietary habits, socioeconomic status, physical activity, and inflammatory status (as measured by C-reactive protein)\u2026Exposure to high temperature stresses the body, eliciting a rapid, robust response. The skin and core body temperatures increase markedly, and sweating ensues. The skin heats first, rising to 40\xB0C (104\xB0F), and then changes in core body temperature occur, rising slowly from 37\xB0C (98.6\xB0F, or normal) to 38\xB0C (100.4\xB0F) and then rapidly increasing to 39\xB0C (102.2\xB0F)\u2026 Cardiac output, a measure of the amount of work the heart performs in response to the body's need for oxygen, increases by 60 to 70 percent, while the heart rate (the number of beats per minute) increases and the stroke volume (the amount of blood pumped) remains unchanged.[5] During this time, approximately 50 to 70 percent of the body's blood flow is redistributed from the core to the skin to facilitate sweating. The average person loses approximately 0.5 kg of sweat while sauna bathing.[11] Acute heat exposure also induces a transient increase in overall plasma volume to mitigate the decrease in core blood volume. This increase in plasma volume not only provides a reserve source of fluid for sweating, but it also acts like the water in a car's radiator, cooling the body to prevent rapid increases in core body temperature and promoting heat tolerance\u2026 Repeated sauna use acclimates the body to heat and optimizes the body's response to future exposures, likely due to a biological phenomenon known as hormesis, a compensatory defense response following exposure to a mild stressor that is disproportionate to the magnitude of the stressor. Hormesis triggers a vast array of protective mechanisms that not only repair cell damage but also provide protection from subsequent exposures to more devastating stressors\u2026 The physiological responses to sauna use are remarkably similar to those experienced during moderate- to vigorous-intensity exercise. In fact, sauna use has been proposed as an alternative to exercise for people who are unable to engage in physical activity due to chronic disease or physical limitations.[13]
@@ -24,16 +24,16 @@ B: Izzy plays Minecraft.
24
24
  C: Emily stops working.
25
25
  D: Russell makes dinner.
26
26
  E: Ashleigh stops by.
27
- ~C \u2228 D`,subject:"formal_logic",choices:["If Emily doesn't stop working then Russell makes dinner.","Emily stops working unless Russell makes dinner.","Emily stops working unless Russell doesn't make dinner.","Emily doesn't stop working unless Russell makes dinner."],answer:3},{question:"The weight percent of sodium hydroxide dissolved in water is 50%. What is the mole fraction of sodium hydroxide?",subject:"high_school_chemistry",choices:["31.00%","0.164","0.311","0.5"],answer:2},{question:"In a certain region, the electric field varies with the radius away from origin by the equation Er = \u20136r^2 + 4r + 3, where r is given in meters and E in N/C. The potential difference between the origin and the point (3, 4) is",subject:"high_school_physics",choices:["\u2013165 V","\u2013120 V","64 V","185 V"],answer:3}];var re=[{s1:"A girl is styling her hair.",s2:"A girl is brushing her hair.",score:2.5},{s1:"A group of men play soccer on the beach.",s2:"A group of boys are playing soccer on the beach.",score:3.6},{s1:"One woman is measuring another woman's ankle.",s2:"A woman measures another woman's ankle.",score:5},{s1:"A man is cutting up a cucumber.",s2:"A man is slicing a cucumber.",score:4.2},{s1:"A man is playing a harp.",s2:"A man is playing a keyboard.",score:1.5},{s1:"A woman is cutting onions.",s2:"A woman is cutting tofu.",score:1.8},{s1:"A man is riding an electric bicycle.",s2:"A man is riding a bicycle.",score:3.5},{s1:"A man is playing the drums.",s2:"A man is playing the guitar.",score:2.2},{s1:"A man is playing guitar.",s2:"A lady is playing the guitar.",score:2.2},{s1:"A man is playing a guitar.",s2:"A man is playing a trumpet.",score:1.714},{s1:"A man is playing a guitar.",s2:"A man is playing a trumpet.",score:1.714},{s1:"A man is cutting an onion.",s2:"A man cuts an onion.",score:5},{s1:"A man is cycling.",s2:"A man is talking.",score:.6},{s1:"A man is slicing open a fish.",s2:"A man is cutting up a fish.",score:4.4},{s1:"A man is slicing a tomato.",s2:"A man is slicing a bun.",score:2},{s1:"A man is playing a guitar.",s2:"A man is playing a keyboard.",score:1.8},{s1:"A baby panda goes down a slide.",s2:"A panda slides down a slide.",score:4.4},{s1:"A man is singing and playing a guitar.",s2:"A man is playing a guitar.",score:3.6},{s1:"A man attacks a woman.",s2:"A man slaps a woman.",score:3.6},{s1:"A man is driving a car.",s2:"A man is riding a horse.",score:1.2},{s1:"A woman is cutting tofu.",s2:"A woman is cutting an onion.",score:2.4},{s1:"The woman is styling her hair.",s2:"The woman is slicing herbs.",score:.2},{s1:"Two zebras play in an open field.",s2:"Two zebras are playing in a field.",score:4.2},{s1:"A man is cutting a potato.",s2:"A man is slicing some potato.",score:4.4},{s1:"A man is slicing an onion.",s2:"A woman is slicing a pumpkin.",score:2.25},{s1:"A man is dancing.",s2:"A man and woman is dancing.",score:2},{s1:"A man is riding a motorcycle.",s2:"A woman is riding a horse.",score:.75},{s1:"A woman is slicing garlics.",s2:"A woman is slicing an onion.",score:2.2},{s1:"A man is speaking.",s2:"A man is cooking.",score:.8},{s1:"A little boy is singing and playing a guitar.",s2:"A man is singing and playing the guitar.",score:2.2},{s1:"A turtle is swimming in water.",s2:"A turtle is walking underwater.",score:3.2},{s1:"A young woman is putting stickers all over her face.",s2:"A woman is applying stickers to her face.",score:4.8},{s1:"A woman is wrapping tofu.",s2:"A woman is balling dough.",score:1.4},{s1:"A cat is eating some corn.",s2:"A cat is eating corn on the cob.",score:4.25},{s1:"A man is eating a food.",s2:"A man is eating a piece of bread.",score:3.4},{s1:"A man is playing a guitar.",s2:"A man is eating pasta.",score:.533},{s1:"A man is kicking pots of water.",s2:"A man is picking flowers.",score:.4},{s1:"A man is cutting a pipe with scissors.",s2:"A man is cutting carpet with a knife.",score:1.2},{s1:"A woman is dancing in the rain.",s2:"A woman dances in the rain out side.",score:5},{s1:"A woman is taking a bath.",s2:"A woman is riding a horse.",score:.538},{s1:"A man mixes vegetables in a pot.",s2:"A person is stirring vegetables in a pot.",score:3.75},{s1:"A woman is talking on a cell phone.",s2:"A man and woman are talking on the phone.",score:3},{s1:"A man is playing a guitar.",s2:"A man is singing while playing the guitar.",score:3.6},{s1:"A man is playing a guitar.",s2:"A man is driving a car.",score:.5},{s1:"A man is cutting apple by his hand.",s2:"A man is cutting carpet with a knife.",score:1.5},{s1:"A man is opening a door.",s2:"A man is cutting an onion.",score:.8},{s1:"A man is slicing a tomato.",s2:"A man is riding a horse.",score:.8},{s1:"A man is cutting paper with a sword.",s2:"A woman is cutting a tomato.",score:.6},{s1:"A boy studies a calendar.",s2:"A boy is looking at a calendar.",score:4.4},{s1:"The ballerina is dancing.",s2:"A man is dancing.",score:1.75},{s1:"A woman is dancing.",s2:"A woman is playing violin.",score:.4},{s1:"A woman is slicing some tomatoes.",s2:"A woman is chopping a potato.",score:1.4},{s1:"A woman is water skiing.",s2:"A woman is slicing fish.",score:.4},{s1:"A man is playing a flute.",s2:"A man is riding a scooter.",score:.8},{s1:"A man is playing the piano.",s2:"A man played the guitar.",score:2},{s1:"A woman is picking a can.",s2:"A man is playing a guitar.",score:.133},{s1:"A man puts three pieces of meat into a pan.",s2:"A man is putting meat in a pan.",score:4},{s1:"A woman is cutting an onion.",s2:"A woman is cleaning a garden.",score:.267},{s1:"Some men are sawing.",s2:"Men are sawing logs.",score:3.4},{s1:"A car is driven down the road.",s2:"A girl is walking down a road.",score:1.2},{s1:"The man is kissing and hugging the woman.",s2:"A man is hugging and kissing a woman.",score:5},{s1:"A train is moving.",s2:"A man is doing yoga.",score:0},{s1:"Someone is slicing an onion.",s2:"A woman is cutting onion.",score:3.8},{s1:"A woman is playing in the ocean.",s2:"A woman is preparing shrimp to cook.",score:.75},{s1:"A person is playing an electronic keyboard.",s2:"A kid is playing keyboard.",score:3.4},{s1:"A man is holding a leaf.",s2:"A monkey is fighting a man.",score:0},{s1:"A woman is peeling shrimp.",s2:"A man is squeezing water.",score:.2},{s1:"A man is sitting and smoking.",s2:"A man is smoking a cigarette.",score:4},{s1:"A man is playing a guitar.",s2:"A woman is riding a horse.",score:.5},{s1:"A man is standing in front of the window and looking outside.",s2:"A man is staring out the window.",score:3.8},{s1:"A skunk is looking here and there.",s2:"A skunk looks at the camera.",score:2.4},{s1:"A man is playing the guitar and singing.",s2:"A man sings with a guitar.",score:4.75},{s1:"A woman opens a window.",s2:"A man is crawling.",score:0},{s1:"People are dancing outside.",s2:"A group of people are dancing.",score:3.75},{s1:"The man is using a camera to hammer a nail.",s2:"Someone is banging a camera lense against a nail.",score:2.6},{s1:"A woman is filing her nails.",s2:"A man is peeling a carrot.",score:0},{s1:"A boy is crawling into a dog house.",s2:"A boy is playing a wooden flute.",score:.75},{s1:"A woman is swimming underwater.",s2:"A man is slicing some carrots.",score:0},{s1:"A machine is sharpening a pencil.",s2:"The machine shaved the end of the pencil.",score:3.8},{s1:"A monkey is playing drums.",s2:"A gorilla plays the drums.",score:2.8},{s1:"A man is opening a box and taking out paper.",s2:"A woman is peeling a potato.",score:0},{s1:"A woman is dancing.",s2:"A woman plays the clarinet.",score:.8},{s1:"A person is drawing on a large touchscreen.",s2:"A man is drawing on a digital dry erase board.",score:3},{s1:"The men played follow the leader on the grass.",s2:"The rhino grazed on the grass.",score:1},{s1:"A woman is cracking eggs.",s2:"A man is talking to a woman.",score:0},{s1:"A woman peels garlic with her hands.",s2:"The woman is slicing herbs.",score:1},{s1:"The polar bears fought over the kill.",s2:"Polar bears are fighting each other.",score:3.4},{s1:"A man is doing trick with play cards.",s2:"A man is performing a card trick.",score:5},{s1:"The cat is licking a bottle.",s2:"A cat plays with a small bottle.",score:2.333},{s1:"A person is slicing an onion.",s2:"A person cuts ginger.",score:1.4},{s1:"A person is peeling a potato with a potato peeler.",s2:"A man is cutting tomatoes with a cleaver.",score:.75},{s1:"Two women are dancing and singing in front of a crowd.",s2:"The women are singing and dancing.",score:3.538},{s1:"A man is seasoning some carrots.",s2:"A woman is slicing garlic.",score:.8},{s1:"Two men pushed carts through the woods.",s2:"Two men are pushing carts.",score:3.5},{s1:"A man is playing a football.",s2:"A man is maneuvering a soccer ball with his feet.",score:2},{s1:"The lady peeled the potatoe.",s2:"A woman is peeling a potato.",score:4.75},{s1:"A woman is slicing some tofu.",s2:"A woman is cutting a block of tofu into small cubes.",score:4},{s1:"Someone typed on a keyboard.",s2:"Someone is typing.",score:4.5},{s1:"Three young men run, jump, and kick off of a Coke machine.",s2:"Three men are jumping off a wall.",score:1.5},{s1:"A young Asian girl is applying eyeliner.",s2:"A girl is putting on eye makeup.",score:2.4}];var ae=["A","B","C","D"],Me=48,Re=400;function Te(e,t){let o=e.choices.map((n,r)=>`${ae[r]}. ${n}`).join(`
27
+ ~C \u2228 D`,subject:"formal_logic",choices:["If Emily doesn't stop working then Russell makes dinner.","Emily stops working unless Russell makes dinner.","Emily stops working unless Russell doesn't make dinner.","Emily doesn't stop working unless Russell makes dinner."],answer:3},{question:"The weight percent of sodium hydroxide dissolved in water is 50%. What is the mole fraction of sodium hydroxide?",subject:"high_school_chemistry",choices:["31.00%","0.164","0.311","0.5"],answer:2},{question:"In a certain region, the electric field varies with the radius away from origin by the equation Er = \u20136r^2 + 4r + 3, where r is given in meters and E in N/C. The potential difference between the origin and the point (3, 4) is",subject:"high_school_physics",choices:["\u2013165 V","\u2013120 V","64 V","185 V"],answer:3}];var re=[{s1:"A girl is styling her hair.",s2:"A girl is brushing her hair.",score:2.5},{s1:"A group of men play soccer on the beach.",s2:"A group of boys are playing soccer on the beach.",score:3.6},{s1:"One woman is measuring another woman's ankle.",s2:"A woman measures another woman's ankle.",score:5},{s1:"A man is cutting up a cucumber.",s2:"A man is slicing a cucumber.",score:4.2},{s1:"A man is playing a harp.",s2:"A man is playing a keyboard.",score:1.5},{s1:"A woman is cutting onions.",s2:"A woman is cutting tofu.",score:1.8},{s1:"A man is riding an electric bicycle.",s2:"A man is riding a bicycle.",score:3.5},{s1:"A man is playing the drums.",s2:"A man is playing the guitar.",score:2.2},{s1:"A man is playing guitar.",s2:"A lady is playing the guitar.",score:2.2},{s1:"A man is playing a guitar.",s2:"A man is playing a trumpet.",score:1.714},{s1:"A man is playing a guitar.",s2:"A man is playing a trumpet.",score:1.714},{s1:"A man is cutting an onion.",s2:"A man cuts an onion.",score:5},{s1:"A man is cycling.",s2:"A man is talking.",score:.6},{s1:"A man is slicing open a fish.",s2:"A man is cutting up a fish.",score:4.4},{s1:"A man is slicing a tomato.",s2:"A man is slicing a bun.",score:2},{s1:"A man is playing a guitar.",s2:"A man is playing a keyboard.",score:1.8},{s1:"A baby panda goes down a slide.",s2:"A panda slides down a slide.",score:4.4},{s1:"A man is singing and playing a guitar.",s2:"A man is playing a guitar.",score:3.6},{s1:"A man attacks a woman.",s2:"A man slaps a woman.",score:3.6},{s1:"A man is driving a car.",s2:"A man is riding a horse.",score:1.2},{s1:"A woman is cutting tofu.",s2:"A woman is cutting an onion.",score:2.4},{s1:"The woman is styling her hair.",s2:"The woman is slicing herbs.",score:.2},{s1:"Two zebras play in an open field.",s2:"Two zebras are playing in a field.",score:4.2},{s1:"A man is cutting a potato.",s2:"A man is slicing some potato.",score:4.4},{s1:"A man is slicing an onion.",s2:"A woman is slicing a pumpkin.",score:2.25},{s1:"A man is dancing.",s2:"A man and woman is dancing.",score:2},{s1:"A man is riding a motorcycle.",s2:"A woman is riding a horse.",score:.75},{s1:"A woman is slicing garlics.",s2:"A woman is slicing an onion.",score:2.2},{s1:"A man is speaking.",s2:"A man is cooking.",score:.8},{s1:"A little boy is singing and playing a guitar.",s2:"A man is singing and playing the guitar.",score:2.2},{s1:"A turtle is swimming in water.",s2:"A turtle is walking underwater.",score:3.2},{s1:"A young woman is putting stickers all over her face.",s2:"A woman is applying stickers to her face.",score:4.8},{s1:"A woman is wrapping tofu.",s2:"A woman is balling dough.",score:1.4},{s1:"A cat is eating some corn.",s2:"A cat is eating corn on the cob.",score:4.25},{s1:"A man is eating a food.",s2:"A man is eating a piece of bread.",score:3.4},{s1:"A man is playing a guitar.",s2:"A man is eating pasta.",score:.533},{s1:"A man is kicking pots of water.",s2:"A man is picking flowers.",score:.4},{s1:"A man is cutting a pipe with scissors.",s2:"A man is cutting carpet with a knife.",score:1.2},{s1:"A woman is dancing in the rain.",s2:"A woman dances in the rain out side.",score:5},{s1:"A woman is taking a bath.",s2:"A woman is riding a horse.",score:.538},{s1:"A man mixes vegetables in a pot.",s2:"A person is stirring vegetables in a pot.",score:3.75},{s1:"A woman is talking on a cell phone.",s2:"A man and woman are talking on the phone.",score:3},{s1:"A man is playing a guitar.",s2:"A man is singing while playing the guitar.",score:3.6},{s1:"A man is playing a guitar.",s2:"A man is driving a car.",score:.5},{s1:"A man is cutting apple by his hand.",s2:"A man is cutting carpet with a knife.",score:1.5},{s1:"A man is opening a door.",s2:"A man is cutting an onion.",score:.8},{s1:"A man is slicing a tomato.",s2:"A man is riding a horse.",score:.8},{s1:"A man is cutting paper with a sword.",s2:"A woman is cutting a tomato.",score:.6},{s1:"A boy studies a calendar.",s2:"A boy is looking at a calendar.",score:4.4},{s1:"The ballerina is dancing.",s2:"A man is dancing.",score:1.75},{s1:"A woman is dancing.",s2:"A woman is playing violin.",score:.4},{s1:"A woman is slicing some tomatoes.",s2:"A woman is chopping a potato.",score:1.4},{s1:"A woman is water skiing.",s2:"A woman is slicing fish.",score:.4},{s1:"A man is playing a flute.",s2:"A man is riding a scooter.",score:.8},{s1:"A man is playing the piano.",s2:"A man played the guitar.",score:2},{s1:"A woman is picking a can.",s2:"A man is playing a guitar.",score:.133},{s1:"A man puts three pieces of meat into a pan.",s2:"A man is putting meat in a pan.",score:4},{s1:"A woman is cutting an onion.",s2:"A woman is cleaning a garden.",score:.267},{s1:"Some men are sawing.",s2:"Men are sawing logs.",score:3.4},{s1:"A car is driven down the road.",s2:"A girl is walking down a road.",score:1.2},{s1:"The man is kissing and hugging the woman.",s2:"A man is hugging and kissing a woman.",score:5},{s1:"A train is moving.",s2:"A man is doing yoga.",score:0},{s1:"Someone is slicing an onion.",s2:"A woman is cutting onion.",score:3.8},{s1:"A woman is playing in the ocean.",s2:"A woman is preparing shrimp to cook.",score:.75},{s1:"A person is playing an electronic keyboard.",s2:"A kid is playing keyboard.",score:3.4},{s1:"A man is holding a leaf.",s2:"A monkey is fighting a man.",score:0},{s1:"A woman is peeling shrimp.",s2:"A man is squeezing water.",score:.2},{s1:"A man is sitting and smoking.",s2:"A man is smoking a cigarette.",score:4},{s1:"A man is playing a guitar.",s2:"A woman is riding a horse.",score:.5},{s1:"A man is standing in front of the window and looking outside.",s2:"A man is staring out the window.",score:3.8},{s1:"A skunk is looking here and there.",s2:"A skunk looks at the camera.",score:2.4},{s1:"A man is playing the guitar and singing.",s2:"A man sings with a guitar.",score:4.75},{s1:"A woman opens a window.",s2:"A man is crawling.",score:0},{s1:"People are dancing outside.",s2:"A group of people are dancing.",score:3.75},{s1:"The man is using a camera to hammer a nail.",s2:"Someone is banging a camera lense against a nail.",score:2.6},{s1:"A woman is filing her nails.",s2:"A man is peeling a carrot.",score:0},{s1:"A boy is crawling into a dog house.",s2:"A boy is playing a wooden flute.",score:.75},{s1:"A woman is swimming underwater.",s2:"A man is slicing some carrots.",score:0},{s1:"A machine is sharpening a pencil.",s2:"The machine shaved the end of the pencil.",score:3.8},{s1:"A monkey is playing drums.",s2:"A gorilla plays the drums.",score:2.8},{s1:"A man is opening a box and taking out paper.",s2:"A woman is peeling a potato.",score:0},{s1:"A woman is dancing.",s2:"A woman plays the clarinet.",score:.8},{s1:"A person is drawing on a large touchscreen.",s2:"A man is drawing on a digital dry erase board.",score:3},{s1:"The men played follow the leader on the grass.",s2:"The rhino grazed on the grass.",score:1},{s1:"A woman is cracking eggs.",s2:"A man is talking to a woman.",score:0},{s1:"A woman peels garlic with her hands.",s2:"The woman is slicing herbs.",score:1},{s1:"The polar bears fought over the kill.",s2:"Polar bears are fighting each other.",score:3.4},{s1:"A man is doing trick with play cards.",s2:"A man is performing a card trick.",score:5},{s1:"The cat is licking a bottle.",s2:"A cat plays with a small bottle.",score:2.333},{s1:"A person is slicing an onion.",s2:"A person cuts ginger.",score:1.4},{s1:"A person is peeling a potato with a potato peeler.",s2:"A man is cutting tomatoes with a cleaver.",score:.75},{s1:"Two women are dancing and singing in front of a crowd.",s2:"The women are singing and dancing.",score:3.538},{s1:"A man is seasoning some carrots.",s2:"A woman is slicing garlic.",score:.8},{s1:"Two men pushed carts through the woods.",s2:"Two men are pushing carts.",score:3.5},{s1:"A man is playing a football.",s2:"A man is maneuvering a soccer ball with his feet.",score:2},{s1:"The lady peeled the potatoe.",s2:"A woman is peeling a potato.",score:4.75},{s1:"A woman is slicing some tofu.",s2:"A woman is cutting a block of tofu into small cubes.",score:4},{s1:"Someone typed on a keyboard.",s2:"Someone is typing.",score:4.5},{s1:"Three young men run, jump, and kick off of a Coke machine.",s2:"Three men are jumping off a wall.",score:1.5},{s1:"A young Asian girl is applying eyeliner.",s2:"A girl is putting on eye makeup.",score:2.4}];var ae=["A","B","C","D"],Me=48,Re=400;function Te(e,t){let n=e.choices.map((o,r)=>`${ae[r]}. ${o}`).join(`
28
28
  `);return `The following is a multiple choice question about ${e.subject.replace(/_/g," ")}.
29
29
 
30
30
  ${e.question}
31
- ${o}
31
+ ${n}
32
32
 
33
33
  Answer with only the letter (A, B, C, or D) of the correct choice.${t??""}
34
- Answer:`}function dt(e){let t=e.replace(/<think>[\s\S]*?<\/think>/gi," "),o=t.search(/<think>/i);return o===-1?t:t.slice(0,o)}function G(e,t){let o=dt(e).trim(),n=o.replace(/[*`_]/g,"").trim(),r=n.match(/(?:^|(?:[Aa]nswer|ANSWER)\s*(?:is)?\s*[:-]?\s*|(?:[Oo]ption|OPTION|[Cc]hoice|CHOICE)\s*[:-]?\s*)\(?([ABCD])\)?(?=[\s.,)!]|$)/);if(r)return ae.indexOf(r[1]);let a=n.match(/^\(?([abcd])(?:\)|\.|$)/);if(a)return ae.indexOf(a[1].toUpperCase());let s=o.toLowerCase();for(let i=0;i<t.length;i++)if(s.startsWith(t[i].toLowerCase().slice(0,Math.max(8,t[i].length))))return i;return null}async function se(e,t,o){let n=D.slice(0,t),r=[],a=[],s=0,i=0;for(let l=0;l<n.length;l++){if(o?.abortSignal?.aborted)throw E();let c=n[l],d=(await e.doGenerate({prompt:Te(c,o?.promptSuffix),maxTokens:Me,temperature:0,abortSignal:o?.abortSignal})).text.slice(0,Re),g=G(d,c.choices);g!==null&&i++;let h=g===c.answer?1:0;s+=h,r.push(h),a.push(d),o?.onProgress?.(l+1,n.length);}return {taskId:`tinymmlu-${t}`,score:n.length===0?0:s/n.length,n:n.length,details:r,outputs:a,parseRate:n.length===0?0:i/n.length}}function ut(e,t){let o=0,n=0,r=0;for(let s=0;s<e.length;s++)o+=e[s]*t[s],n+=e[s]*e[s],r+=t[s]*t[s];let a=Math.sqrt(n)*Math.sqrt(r);return a===0?0:o/a}async function ie(e,t,o){let n=re.slice(0,t),r=[],a=[];for(let s=0;s<n.length;s++){if(o?.abortSignal?.aborted)throw E();let i=n[s],{embeddings:l}=await e.doEmbed({values:[i.s1,i.s2],abortSignal:o?.abortSignal});r.push(ut(l[0],l[1])),a.push(i.score),o?.onProgress?.(s+1,n.length);}return {taskId:`stsb-${t}`,score:r.length>=2?oe(r,a):0,n:n.length,details:r.map(s=>Math.round(s*1e4)/1e4)}}var mt=2,_e=.2,ht=[{maxBytes:5e8,max:4e3},{maxBytes:1e9,max:2500},{maxBytes:2e9,max:1500},{maxBytes:Number.POSITIVE_INFINITY,max:1e3}],pt=2e3,gt=[/swiftshader/i,/llvmpipe/i,/softpipe/i,/\bwarp\b/i,/microsoft basic render/i,/parallels/i,/vmware/i,/virtio/i,/virtualbox/i];function Ee(e){let t=[],o=s=>{t.length<50&&t.push(s);};if(typeof e!="object"||e===null)return ["result must be an object"];let n=e;n.protocol!==C&&o(`protocol must be "${C}"`),n.schemaVersion!==2&&o(`schemaVersion must be ${2}`),(typeof n.runId!="string"||n.runId.length<8||n.runId.length>64)&&o("runId must be a string (8-64 chars)"),(typeof n.createdAt!="string"||Number.isNaN(Date.parse(n.createdAt)))&&o("createdAt must be an ISO date string");let r=n.harness;(!r||typeof r.name!="string"||typeof r.version!="string")&&o("harness {name, version} is required"),["quick","standard","thorough","custom"].includes(n.suite)||o("suite must be quick|standard|thorough|custom");let a=n.environment;if(!a||typeof a!="object")o("environment is required");else {let s=a.browser;(!s||typeof s.name!="string")&&o("environment.browser.name is required"),(!a.os||typeof a.os.platform!="string")&&o("environment.os.platform is required");}return Array.isArray(n.cells)?n.cells.length===0?o("cells must not be empty"):n.cells.length>500?o("cells exceeds the 500-cell limit"):n.cells.forEach((s,i)=>ft(s,i,o)):o("cells must be an array"),Array.isArray(n.events)||o("events must be an array"),t}function ft(e,t,o){if(typeof e!="object"||e===null){o(`cells[${t}] must be an object`);return}let n=e,r=`cells[${t}]`;typeof n.cellId!="string"&&o(`${r}.cellId must be a string`),typeof n.runtimeId!="string"&&o(`${r}.runtimeId must be a string`),typeof n.workloadId!="string"&&o(`${r}.workloadId must be a string`),["ok","invalid","error","skipped"].includes(n.status)||o(`${r}.status must be ok|invalid|error|skipped`);let a=n.model;(!a||typeof a.benchModelId!="string"||typeof a.providerModelId!="string")&&o(`${r}.model {benchModelId, providerModelId} is required`);let s=n.quality;if(s&&Array.isArray(s.outputs)&&s.outputs.some(i=>typeof i!="string"||i.length>500)&&o(`${r}.quality.outputs must be strings of at most 500 chars`),!Array.isArray(n.iterations)){o(`${r}.iterations must be an array`);return}n.iterations.forEach((i,l)=>{if(typeof i!="object"||i===null){o(`${r}.iterations[${l}] must be an object`);return}let c=i;(typeof c.startT!="number"||typeof c.endT!="number")&&o(`${r}.iterations[${l}] needs numeric startT/endT`),"chunks"in c&&!Array.isArray(c.chunks)&&o(`${r}.iterations[${l}].chunks must be an array`),"text"in c&&typeof c.text=="string"&&c.text.length>2e4&&o(`${r}.iterations[${l}].text exceeds 20000 chars`);});}function Pe(e){return e.length>0&&"chunks"in e[0]}function Y(e){let t=e.chunks.filter(r=>r.c>0);if(t.length<2)return false;let o=t[t.length-1].t-t[0].t,n=e.endT-e.startT;return n>0&&o/n>=_e}function K(e,t=.05,o){let n={cellId:e.cellId,status:e.status,highVariance:false};if(e.load&&(n.loadMs=e.load.endT-e.load.startT,n.loadCached=e.load.cached),e.quality&&(n.qualityScore=e.quality.score,e.quality.parseRate!==void 0&&(n.qualityParseRate=e.quality.parseRate)),e.iterations.length===0)return n;if(Pe(e.iterations)){let a=e.iterations.every(Y);n.streamIncremental=a;let s=[],i=[],l=[],c=[],u=[],d=[],g=[];for(let h of e.iterations){let m=h.chunks.reduce((I,j)=>I+j.c,0),f=h.endT-h.startT;if(f>0&&(d.push(f),m>0&&g.push(m/f*1e3)),c.push(m),!a)continue;let p=h.chunks.find(I=>I.c>0);if(!p)continue;let w=p.t-h.startT;s.push(w);let S=h.chunks[h.chunks.length-1],M=m-p.c,R=S.t-p.t;R>0&&M>0&&(i.push(M/R*1e3),l.push((h.chunks.length-1)/R*1e3)),o&&w>0&&u.push(o/w*1e3);}s.length>0&&(n.ttftMs=A(s)),i.length>0&&(n.decodeCharsPerSec=A(i)),l.length>0&&(n.decodeChunksPerSec=A(l)),c.length>0&&(n.generatedChars=A(c)),u.length>0&&(n.prefillTokPerSecApprox=A(u)),d.length>0&&(n.totalMs=A(d)),g.length>0&&(n.overallCharsPerSec=A(g));}else {let a=e.iterations,s=a.map(i=>i.endT-i.startT).filter(i=>i>0);s.length>0&&(a[0].count===1?n.singleLatencyMs=A(s):n.batchTextsPerSec=A(a.filter(i=>i.endT-i.startT>0).map(i=>i.count/(i.endT-i.startT)*1e3)));}let r=[n.ttftMs,n.decodeCharsPerSec,n.overallCharsPerSec,n.singleLatencyMs,n.batchTextsPerSec];return n.highVariance=r.some(a=>a!==void 0&&a.n>=2&&a.cv>t),n}function q(e,t=.05,o){let r=o??new Map([["chat-pp128-tg128",128],["chat-pp512-tg128",512]]);return e.cells.map(a=>K(a,t,r.get(a.workloadId)))}function Ce(e){let t=[],o=(i,l,c,u)=>t.push({code:i,message:l,severity:c,...u?{cellId:u}:{}});e.fingerprint?(e.fingerprint.mflops<=1||e.fingerprint.mflops>1e5||!Number.isFinite(e.fingerprint.checksum))&&o("fingerprint-implausible",`fingerprint mflops=${e.fingerprint.mflops}`,"reject"):o("fingerprint-missing","no hardware fingerprint in submission","reject");let n=e.environment.timerResolutionUs;for(let i of e.cells)if(i.status==="ok"){if(i.load&&i.load.endT<i.load.startT&&o("load-time-reversed","load endT precedes startT","reject",i.cellId),Pe(i.iterations)){for(let d of i.iterations){let g=d.startT,h=true;for(let f of d.chunks)f.t<g&&(h=false),g=f.t;if(!h||d.endT<g){o("trace-not-monotonic","chunk timestamps are not monotonic","reject",i.cellId);break}let m=d.chunks.reduce((f,p)=>f+p.c,0);if(d.text.length!==m){o("text-chunk-mismatch",`text length ${d.text.length} != chunk sum ${m}`,"reject",i.cellId);break}}let l=K(i);i.iterations.some(d=>d.text.length<_)&&o("degenerate-generation",`an ok cell has a timed iteration with fewer than ${_} generated chars`,"reject",i.cellId);let c=i.model.sizeBytes??Number.POSITIVE_INFINITY,u=ht.find(d=>c<=d.maxBytes);if(u&&l.decodeCharsPerSec&&l.decodeCharsPerSec.median>u.max&&o("decode-rate-envelope",`decode ${Math.round(l.decodeCharsPerSec.median)} chars/s exceeds envelope ${u.max} for model size`,"reject",i.cellId),u&&l.overallCharsPerSec&&l.overallCharsPerSec.median>u.max&&o("overall-rate-envelope",`overall ${Math.round(l.overallCharsPerSec.median)} chars/s exceeds envelope ${u.max} for model size`,"reject",i.cellId),l.ttftMs&&l.ttftMs.median<1&&o("ttft-implausible",`median TTFT ${l.ttftMs.median}ms < 1ms`,"reject",i.cellId),n!=null&&n>=4){let d=n/1e3,g=0,h=0;for(let m of i.iterations)for(let f of m.chunks)h++,Math.abs(f.t/d-Math.round(f.t/d))>.01&&g++;h>=20&&g/h>.5&&o("timer-grid",`${g}/${h} chunk timestamps off the ${n}us timer grid`,"warn",i.cellId);}}else if(i.quality?.taskId.startsWith("tinymmlu")&&i.quality.outputs){let{outputs:l,details:c,score:u,n:d}=i.quality;if(l.length!==d||!c||c.length!==d)o("quality-outputs-mismatch","quality outputs/details length disagrees with n","reject",i.cellId);else {let g=0,h=true;for(let m=0;m<d;m++){let f=D[m];if(!f)break;let p=G(l[m],f.choices)===f.answer?1:0;g+=p,p!==c[m]&&(h=false);}(!h||Math.abs(g/d-u)>1e-9)&&o("quality-details-mismatch",`submitted MMLU score ${u} disagrees with recompute ${g/d} from raw outputs`,"reject",i.cellId);}}else if(i.iterations.length>0){let l=K(i);l.batchTextsPerSec&&l.batchTextsPerSec.median>pt&&o("embed-rate-envelope",`embedding throughput ${Math.round(l.batchTextsPerSec.median)} texts/s exceeds envelope`,"reject",i.cellId),l.singleLatencyMs&&l.singleLatencyMs.median<.05&&o("embed-latency-implausible","sub-50us embedding latency","reject",i.cellId);}}let r=e.environment.gpu.vendor?.toLowerCase()??"",a=e.environment.os.platform.toLowerCase();r==="apple"&&a.includes("windows")&&o("env-cross-field","Apple GPU adapter with Windows platform","reject");let s=[e.environment.gpu.vendor,e.environment.gpu.architecture,e.environment.gpu.device,e.environment.gpu.description,e.environment.webglRenderer].filter(Boolean).join(" ");if(gt.some(i=>i.test(s))){let i=e.cells.some(l=>l.status==="ok"&&/webgpu|^gpu$/.test(l.resolvedBackend));o("software-renderer",`GPU identity matches a software/virtual renderer: "${s.slice(0,120)}"`,i?"reject":"warn");}return t}function bt(e){let t=Ee(e);if(t.length>0)return {ok:false,shapeErrors:t,flags:[],summaries:[]};let o=q(e),n=Ce(e);if(e.clientSummaries){let r=new Map(o.map(a=>[a.cellId,a]));for(let a of e.clientSummaries){let s=r.get(a.cellId);if(s)for(let i of ["ttftMs","decodeCharsPerSec","totalMs","overallCharsPerSec","singleLatencyMs","batchTextsPerSec"]){let l=a[i]?.median,c=s[i]?.median;l!==void 0&&c!==void 0&&c!==0&&Math.abs(l-c)/Math.abs(c)>.01&&n.push({code:"client-summary-disagrees",cellId:a.cellId,message:`${i} client median ${l} vs recomputed ${c}`,severity:"reject"});}}}return {ok:n.every(r=>r.severity!=="reject"),shapeErrors:[],flags:n,summaries:o}}async function yt(e){let{policy:t,hooks:o,abortSignal:n}=e,r=new W;await r.attach(),r.record("suite-start",e.suite);let a=z(),s=[];try{o?.onPhase?.("environment");let i=await te({userReportedDevice:e.userReportedDevice});o?.onPhase?.("fingerprint"),T(n);let l=e.skipFingerprint?null:await ne(),c=a!=="none"?await B():null,u=wt(J(e.cells)),d=e.cells.length,g=0;for(let m of u){T(n);let f=await vt(m,{...e,trace:r,memApi:a,baselineMemory:c,cellIndexRef:()=>g++,totalCells:d});s.push(...f),r.record("cooldown-start"),await H(t.cooldownMs,n).catch(p=>{if(p.name==="AbortError")throw p}),t.pressureGate&&await At(r,t.pressureGateTimeoutMs,n),r.record("cooldown-end");}r.record("suite-end");let h={protocol:C,schemaVersion:2,runId:xt(),createdAt:new Date().toISOString(),harness:e.harness,suite:e.suite,environment:i,fingerprint:l,cells:s,events:[...r.all]};return h.clientSummaries=q(h,t.highVarianceCv),h}finally{await r.dispose();}}function wt(e){let t=new Map;for(let o of e){let n=`${o.model.runtimeId}/${o.model.benchModelId}/${o.model.providerModelId}`,r=t.get(n);r||(r={key:n,model:o.model,workloads:[]},t.set(n,r)),r.workloads.push(o.workload);}return [...t.values()]}async function vt(e,t){let{model:o}=e,n=o.task==="embedding",r=n?t.embedAdapters.get(o.runtimeId):t.llmAdapters.get(o.runtimeId),a=[],s=h=>({cellId:`${o.runtimeId}/${o.benchModelId}/${h.id}`,runtimeId:o.runtimeId,runtimeVersion:r?.runtimeVersion,model:o,workloadId:h.id,workloadKind:h.kind,resolvedBackend:"unknown",load:null,iterations:[],status:"skipped"});if(!r){for(let h of e.workloads){let m=s(h);m.invalidReasons=[`no adapter registered for ${o.runtimeId}`],a.push(O(m,t));}return a}let i=await r.isAvailable();if(!i.ok){for(let h of e.workloads){let m=s(h);m.invalidReasons=[`runtime unavailable: ${i.reason??"unknown"}`],a.push(O(m,t));}return a}let l=null,c=null,u,d=null;try{T(t.abortSignal);let h=await r.isModelCached(o),m=[],f=b(),p=`${o.runtimeId}/${o.benchModelId}/${e.workloads[0].id}`;l=await r.load(o,{abortSignal:t.abortSignal,onProgress:S=>{typeof S.pct=="number"&&(m.length===0||S.pct-m[m.length-1].pct>=2)&&m.push({t:b(),pct:Math.round(S.pct*100)/100}),t.hooks?.onLoadProgress?.(p,S.pct);}});let w=b();if(c={cached:h,startT:f,endT:w,progress:m.length>0?It(m,50):void 0,declaredBytes:o.sizeBytes},t.memApi!=="none"&&(d=await B()),t.policy.warmupRuns>0){let S=b();for(let M=0;M<t.policy.warmupRuns;M++)T(t.abortSignal),n?await l.model.doEmbed({values:["warmup probe"],abortSignal:t.abortSignal}):await Be(l.model,{prompt:"Reply with the single word: ready",maxTokens:4,temperature:0},t.abortSignal);u=b()-S;}}catch(h){if(h.name==="AbortError")throw l&&await U(l),h;let m=t.memApi!=="none"?await B(5e3):null;for(let f of e.workloads){let p=s(f);p.status="error",p.load=c,p.error=Le(h),t.memApi!=="none"&&(p.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:d??void 0,atError:m??void 0}),a.push(O(p,t));}return l&&await U(l),a}let g=false;for(let h of e.workloads){T(t.abortSignal);let m=s(h);m.resolvedBackend=l.resolvedBackend,g||(m.load=c,m.warmupMs=u,g=true);let f=t.cellIndexRef();t.hooks?.onCellStart?.(m.cellId,f,t.totalCells);try{switch(h.kind){case "llm-generate":await kt(m,l,h,t);break;case "embed-single":case "embed-batch":await St(m,l,h,t);break;case "quality-mmlu":{let p=h.items;m.quality=await se(l.model,p,{abortSignal:t.abortSignal,onProgress:w=>t.hooks?.onIteration?.(m.cellId,w,p),promptSuffix:o.qualityPromptSuffix}),m.status="ok";break}case "quality-sts":{let p=h.items;m.quality=await ie(l.model,p,{abortSignal:t.abortSignal,onProgress:w=>t.hooks?.onIteration?.(m.cellId,w,p)}),m.status="ok";break}}}catch(p){if(p.name==="AbortError")throw await U(l),p;m.status="error",m.error=Le(p);}if(t.memApi!=="none"&&(m.status==="ok"||m.status==="error")){let p=await B(5e3);m.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:d??void 0,...m.status==="ok"?{postRun:p??void 0}:{atError:p??void 0}};}a.push(O(m,t));}if(await U(l),t.policy.measureWarmReload&&c?.cached===false)try{T(t.abortSignal);let h=b(),m=await r.load(o,{abortSignal:t.abortSignal}),f=b();await U(m);let p={cellId:`${o.runtimeId}/${o.benchModelId}/warm-reload`,runtimeId:o.runtimeId,runtimeVersion:r.runtimeVersion,model:o,workloadId:"warm-reload",workloadKind:"llm-generate",resolvedBackend:m.resolvedBackend,load:{cached:!0,startT:h,endT:f,declaredBytes:o.sizeBytes},iterations:[],status:"ok"};a.push(O(p,t));}catch(h){if(h.name==="AbortError")throw h}return a}async function kt(e,t,o,n){let r=[];for(let s=0;s<n.policy.timedRuns;s++){T(n.abortSignal),n.hooks?.onIteration?.(e.cellId,s+1,n.policy.timedRuns);let i=[];n.trace.isHidden&&i.push("started-hidden");let l=Q(n.trace),c=b(),{chunks:u,text:d,providerUsage:g,finishReason:h}=await Be(t.model,{prompt:o.prompt,systemPrompt:o.systemPrompt,maxTokens:o.maxTokens,temperature:o.temperature},n.abortSignal),m=b();Q(n.trace)>l&&i.push("hidden-during-run"),d.length<_&&i.push("degenerate-output"),r.push({startT:c,chunks:u,endT:m,text:d,providerUsage:g?{...g,fidelity:Z[e.runtimeId]}:void 0,finishReason:h,gates:i});}e.iterations=r;let a=r.some(s=>s.gates.length>0);if(e.status=a?"invalid":"ok",a){let s=new Set;for(let i of r)for(let l of i.gates)s.add(l==="degenerate-output"?`degenerate output: fewer than ${_} generated chars in a timed iteration`:"validity gate fired during a timed region");e.invalidReasons=[...s];}}async function St(e,t,o,n){let r=[];for(let s=0;s<n.policy.timedRuns;s++){T(n.abortSignal),n.hooks?.onIteration?.(e.cellId,s+1,n.policy.timedRuns);let i=[];n.trace.isHidden&&i.push("started-hidden");let l=Q(n.trace),c=b(),{embeddings:u}=await t.model.doEmbed({values:o.texts,abortSignal:n.abortSignal}),d=b();Q(n.trace)>l&&i.push("hidden-during-run"),r.push({startT:c,endT:d,count:o.texts.length,dimensions:u[0]?.length??t.model.dimensions,gates:i});}e.iterations=r;let a=r.some(s=>s.gates.length>0);e.status=a?"invalid":"ok",a&&(e.invalidReasons=["validity gate fired during a timed region"]);}async function Be(e,t,o){let n=[],r="",a,s;if(e.doStream)for await(let i of e.doStream({...t,abortSignal:o})){let l=b();i.text.length>0&&(n.push({t:l,c:i.text.length}),r+=i.text),i.done&&(a=i.usage,s=i.finishReason);}else {let i=await e.doGenerate({...t,abortSignal:o}),l=b();r=i.text,n.push({t:l,c:i.text.length}),a=i.usage,s=i.finishReason;}return {chunks:n,text:r,providerUsage:a,finishReason:s}}function Q(e){let t=0;for(let o of e.all)o.type==="visibility-hidden"&&t++;return t}async function At(e,t,o){let n=b()+t;for(;b()<n;){let r=e.pressureState;if(r===void 0||r==="nominal"||r==="fair")return;await H(1e3,o);}}function It(e,t){if(e.length<=t)return e;let o=[],n=(e.length-1)/(t-1);for(let r=0;r<t;r++)o.push(e[Math.round(r*n)]);return o}function Le(e){let t=e,o=t?.cause,n=o instanceof Error?o.message:typeof o=="string"?o:void 0;return {name:t?.name??"Error",message:t?.message??String(e),...n?{cause:n}:{}}}function O(e,t){return t.hooks?.onCellFinish?.(e),e}async function U(e){try{await e.dispose();}catch{}}function T(e){if(e?.aborted)throw E()}function xt(){let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID();let t=new Uint8Array(16);if(e?.getRandomValues)e.getRandomValues(t);else for(let n=0;n<16;n++)t[n]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let o=[...t].map(n=>n.toString(16).padStart(2,"0")).join("");return `${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}function qe(e){return le(e)}function le(e){if(e===null||typeof e=="number"||typeof e=="boolean"||typeof e=="string")return JSON.stringify(e);if(typeof e>"u")return "null";if(Array.isArray(e))return `[${e.map(t=>le(t)).join(",")}]`;if(typeof e=="object")return `{${Object.entries(e).filter(([,o])=>o!==void 0).sort(([o],[n])=>o<n?-1:o>n?1:0).map(([o,n])=>`${JSON.stringify(o)}:${le(n)}`).join(",")}}`;throw new TypeError(`canonicalJson: unsupported value type ${typeof e}`)}async function je(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("Web Crypto (crypto.subtle) is not available in this environment");let o=new TextEncoder().encode(e),n=await t.digest("SHA-256",o);return [...new Uint8Array(n)].map(r=>r.toString(16).padStart(2,"0")).join("")}async function We(e){let{digest:t,...o}=e;return je(qe(o))}async function Mt(e){return e.digest?await We(e)===e.digest:false}function de(e){let t=e.environment,o=t.gpu.available?[t.gpu.vendor??"gpu",t.gpu.architecture].filter(Boolean).join("-"):"no-webgpu";return [t.os.platform.toLowerCase().replace(/\s+/g,"-"),o].join("/")}var De=3;function Rt(e,t=De){let o=new Map;for(let r of e){let a=de(r),s=r.clientSummaries??q(r),i=new Map(s.map(l=>[l.cellId,l]));for(let l of r.cells){if(l.status!=="ok")continue;let c=i.get(l.cellId);if(!c)continue;let u=[a,l.runtimeId,l.model.benchModelId,l.workloadId].join("|"),d=o.get(u);d||(d={row:{deviceClass:a,runtimeId:l.runtimeId,benchModelId:l.model.benchModelId,modelName:l.model.displayName,workloadId:l.workloadId,resolvedBackends:[],browsers:[],highVariance:false},ttft:[],decode:[],overall:[],single:[],batch:[],loadCold:[],loadWarm:[],quality:[],parseRate:[],runIds:new Set},o.set(u,d)),d.runIds.add(r.runId),Ne(d.row.resolvedBackends,l.resolvedBackend),Ne(d.row.browsers,r.environment.browser.name),d.row.highVariance||=c.highVariance,c.ttftMs&&d.ttft.push(c.ttftMs.median),c.decodeCharsPerSec&&d.decode.push(c.decodeCharsPerSec.median),c.overallCharsPerSec&&d.overall.push(c.overallCharsPerSec.median),c.singleLatencyMs&&d.single.push(c.singleLatencyMs.median),c.batchTextsPerSec&&d.batch.push(c.batchTextsPerSec.median),c.loadMs!==void 0&&(c.loadCached?d.loadWarm:d.loadCold).push(c.loadMs),c.qualityScore!==void 0&&d.quality.push(c.qualityScore),c.qualityParseRate!==void 0&&d.parseRate.push(c.qualityParseRate);}}let n=[];for(let r of o.values())n.push({...r.row,submissions:r.runIds.size,ttftMs:x(r.ttft),decodeCharsPerSec:x(r.decode),overallCharsPerSec:x(r.overall),singleLatencyMs:x(r.single),batchTextsPerSec:x(r.batch),loadColdMs:x(r.loadCold),loadWarmMs:x(r.loadWarm),qualityScore:x(r.quality),qualityParseRate:x(r.parseRate),provisional:r.runIds.size<t});return n.sort((r,a)=>r.deviceClass.localeCompare(a.deviceClass)||r.benchModelId.localeCompare(a.benchModelId)||r.runtimeId.localeCompare(a.runtimeId)||r.workloadId.localeCompare(a.workloadId)),n}function Ne(e,t){t&&!e.includes(t)&&e.push(t);}function x(e){return e.length>0?P($(e)):void 0}function P(e){return Math.round(e*100)/100}function ce(e){let t=e==null?"":String(e);return /[",\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function Tt(e){let o=[["deviceClass","runtimeId","benchModelId","modelName","workloadId","submissions","ttftMs","decodeCharsPerSec","overallCharsPerSec","singleLatencyMs","batchTextsPerSec","loadColdMs","loadWarmMs","qualityScore","qualityParseRate","resolvedBackends","browsers","highVariance","provisional"].join(",")];for(let n of e)o.push([n.deviceClass,n.runtimeId,n.benchModelId,n.modelName,n.workloadId,n.submissions,n.ttftMs,n.decodeCharsPerSec,n.overallCharsPerSec,n.singleLatencyMs,n.batchTextsPerSec,n.loadColdMs,n.loadWarmMs,n.qualityScore,n.qualityParseRate,n.resolvedBackends.join(";"),n.browsers.join(";"),n.highVariance,n.provisional].map(ce).join(","));return o.join(`
34
+ Answer:`}function dt(e){let t=e.replace(/<think>[\s\S]*?<\/think>/gi," "),n=t.search(/<think>/i);return n===-1?t:t.slice(0,n)}function G(e,t){let n=dt(e).trim(),o=n.replace(/[*`_]/g,"").trim(),r=o.match(/(?:^|(?:[Aa]nswer|ANSWER)\s*(?:is)?\s*[:-]?\s*|(?:[Oo]ption|OPTION|[Cc]hoice|CHOICE)\s*[:-]?\s*)\(?([ABCD])\)?(?=[\s.,)!]|$)/);if(r)return ae.indexOf(r[1]);let a=o.match(/^\(?([abcd])(?:\)|\.|$)/);if(a)return ae.indexOf(a[1].toUpperCase());let s=n.toLowerCase();for(let i=0;i<t.length;i++)if(s.startsWith(t[i].toLowerCase().slice(0,Math.max(8,t[i].length))))return i;return null}async function se(e,t,n){let o=O.slice(0,t),r=[],a=[],s=0,i=0;for(let l=0;l<o.length;l++){if(n?.abortSignal?.aborted)throw E();let c=o[l],d=(await e.doGenerate({prompt:Te(c,n?.promptSuffix),maxTokens:Me,temperature:0,abortSignal:n?.abortSignal})).text.slice(0,Re),g=G(d,c.choices);g!==null&&i++;let h=g===c.answer?1:0;s+=h,r.push(h),a.push(d),n?.onProgress?.(l+1,o.length);}return {taskId:`tinymmlu-${t}`,score:o.length===0?0:s/o.length,n:o.length,details:r,outputs:a,parseRate:o.length===0?0:i/o.length}}function ut(e,t){let n=0,o=0,r=0;for(let s=0;s<e.length;s++)n+=e[s]*t[s],o+=e[s]*e[s],r+=t[s]*t[s];let a=Math.sqrt(o)*Math.sqrt(r);return a===0?0:n/a}async function ie(e,t,n){let o=re.slice(0,t),r=[],a=[];for(let s=0;s<o.length;s++){if(n?.abortSignal?.aborted)throw E();let i=o[s],{embeddings:l}=await e.doEmbed({values:[i.s1,i.s2],abortSignal:n?.abortSignal});r.push(ut(l[0],l[1])),a.push(i.score),n?.onProgress?.(s+1,o.length);}return {taskId:`stsb-${t}`,score:r.length>=2?oe(r,a):0,n:o.length,details:r.map(s=>Math.round(s*1e4)/1e4)}}var mt=2,_e=.2,ht=[{maxBytes:5e8,max:4e3},{maxBytes:1e9,max:2500},{maxBytes:2e9,max:1500},{maxBytes:Number.POSITIVE_INFINITY,max:1e3}],pt=2e3,gt=[/swiftshader/i,/llvmpipe/i,/softpipe/i,/\bwarp\b/i,/microsoft basic render/i,/parallels/i,/vmware/i,/virtio/i,/virtualbox/i];function Ee(e){let t=[],n=s=>{t.length<50&&t.push(s);};if(typeof e!="object"||e===null)return ["result must be an object"];let o=e;o.protocol!==C&&n(`protocol must be "${C}"`),o.schemaVersion!==2&&n(`schemaVersion must be ${2}`),(typeof o.runId!="string"||o.runId.length<8||o.runId.length>64)&&n("runId must be a string (8-64 chars)"),(typeof o.createdAt!="string"||Number.isNaN(Date.parse(o.createdAt)))&&n("createdAt must be an ISO date string");let r=o.harness;(!r||typeof r.name!="string"||typeof r.version!="string")&&n("harness {name, version} is required"),["quick","standard","thorough","custom"].includes(o.suite)||n("suite must be quick|standard|thorough|custom");let a=o.environment;if(!a||typeof a!="object")n("environment is required");else {let s=a.browser;(!s||typeof s.name!="string")&&n("environment.browser.name is required"),(!a.os||typeof a.os.platform!="string")&&n("environment.os.platform is required");}return Array.isArray(o.cells)?o.cells.length===0?n("cells must not be empty"):o.cells.length>500?n("cells exceeds the 500-cell limit"):o.cells.forEach((s,i)=>ft(s,i,n)):n("cells must be an array"),Array.isArray(o.events)||n("events must be an array"),t}function ft(e,t,n){if(typeof e!="object"||e===null){n(`cells[${t}] must be an object`);return}let o=e,r=`cells[${t}]`;typeof o.cellId!="string"&&n(`${r}.cellId must be a string`),typeof o.runtimeId!="string"&&n(`${r}.runtimeId must be a string`),typeof o.workloadId!="string"&&n(`${r}.workloadId must be a string`),["ok","invalid","error","skipped"].includes(o.status)||n(`${r}.status must be ok|invalid|error|skipped`);let a=o.model;(!a||typeof a.benchModelId!="string"||typeof a.providerModelId!="string")&&n(`${r}.model {benchModelId, providerModelId} is required`);let s=o.quality;if(s&&Array.isArray(s.outputs)&&s.outputs.some(i=>typeof i!="string"||i.length>500)&&n(`${r}.quality.outputs must be strings of at most 500 chars`),!Array.isArray(o.iterations)){n(`${r}.iterations must be an array`);return}o.iterations.forEach((i,l)=>{if(typeof i!="object"||i===null){n(`${r}.iterations[${l}] must be an object`);return}let c=i;(typeof c.startT!="number"||typeof c.endT!="number")&&n(`${r}.iterations[${l}] needs numeric startT/endT`),"chunks"in c&&!Array.isArray(c.chunks)&&n(`${r}.iterations[${l}].chunks must be an array`),"text"in c&&typeof c.text=="string"&&c.text.length>2e4&&n(`${r}.iterations[${l}].text exceeds 20000 chars`);});}function Pe(e){return e.length>0&&"chunks"in e[0]}function Y(e){let t=e.chunks.filter(r=>r.c>0);if(t.length<2)return false;let n=t[t.length-1].t-t[0].t,o=e.endT-e.startT;return o>0&&n/o>=_e}function K(e,t=.05,n){let o={cellId:e.cellId,status:e.status,highVariance:false};if(e.load&&(o.loadMs=e.load.endT-e.load.startT,o.loadCached=e.load.cached),e.quality&&(o.qualityScore=e.quality.score,e.quality.parseRate!==void 0&&(o.qualityParseRate=e.quality.parseRate)),e.iterations.length===0)return o;if(Pe(e.iterations)){let a=e.iterations.every(Y);o.streamIncremental=a;let s=[],i=[],l=[],c=[],m=[],d=[],g=[];for(let h of e.iterations){let u=h.chunks.reduce((I,W)=>I+W.c,0),f=h.endT-h.startT;if(f>0&&(d.push(f),u>0&&g.push(u/f*1e3)),c.push(u),!a)continue;let p=h.chunks.find(I=>I.c>0);if(!p)continue;let w=p.t-h.startT;s.push(w);let S=h.chunks[h.chunks.length-1],M=u-p.c,R=S.t-p.t;R>0&&M>0&&(i.push(M/R*1e3),l.push((h.chunks.length-1)/R*1e3)),n&&w>0&&m.push(n/w*1e3);}s.length>0&&(o.ttftMs=A(s)),i.length>0&&(o.decodeCharsPerSec=A(i)),l.length>0&&(o.decodeChunksPerSec=A(l)),c.length>0&&(o.generatedChars=A(c)),m.length>0&&(o.prefillTokPerSecApprox=A(m)),d.length>0&&(o.totalMs=A(d)),g.length>0&&(o.overallCharsPerSec=A(g));}else {let a=e.iterations,s=a.map(i=>i.endT-i.startT).filter(i=>i>0);s.length>0&&(a[0].count===1?o.singleLatencyMs=A(s):o.batchTextsPerSec=A(a.filter(i=>i.endT-i.startT>0).map(i=>i.count/(i.endT-i.startT)*1e3)));}let r=[o.ttftMs,o.decodeCharsPerSec,o.overallCharsPerSec,o.singleLatencyMs,o.batchTextsPerSec];return o.highVariance=r.some(a=>a!==void 0&&a.n>=2&&a.cv>t),o}function q(e,t=.05,n){let r=n??new Map([["chat-pp128-tg128",128],["chat-pp512-tg128",512]]);return e.cells.map(a=>K(a,t,r.get(a.workloadId)))}function Ce(e){let t=[],n=(i,l,c,m)=>t.push({code:i,message:l,severity:c,...m?{cellId:m}:{}});e.fingerprint?(e.fingerprint.mflops<=1||e.fingerprint.mflops>1e5||!Number.isFinite(e.fingerprint.checksum))&&n("fingerprint-implausible",`fingerprint mflops=${e.fingerprint.mflops}`,"reject"):n("fingerprint-missing","no hardware fingerprint in submission","reject");let o=e.environment.timerResolutionUs;for(let i of e.cells)if(i.status==="ok"){if(i.load&&i.load.endT<i.load.startT&&n("load-time-reversed","load endT precedes startT","reject",i.cellId),Pe(i.iterations)){for(let d of i.iterations){let g=d.startT,h=true;for(let f of d.chunks)f.t<g&&(h=false),g=f.t;if(!h||d.endT<g){n("trace-not-monotonic","chunk timestamps are not monotonic","reject",i.cellId);break}let u=d.chunks.reduce((f,p)=>f+p.c,0);if(d.text.length!==u){n("text-chunk-mismatch",`text length ${d.text.length} != chunk sum ${u}`,"reject",i.cellId);break}}let l=K(i);i.iterations.some(d=>d.text.length<_)&&n("degenerate-generation",`an ok cell has a timed iteration with fewer than ${_} generated chars`,"reject",i.cellId);let c=i.model.sizeBytes??Number.POSITIVE_INFINITY,m=ht.find(d=>c<=d.maxBytes);if(m&&l.decodeCharsPerSec&&l.decodeCharsPerSec.median>m.max&&n("decode-rate-envelope",`decode ${Math.round(l.decodeCharsPerSec.median)} chars/s exceeds envelope ${m.max} for model size`,"reject",i.cellId),m&&l.overallCharsPerSec&&l.overallCharsPerSec.median>m.max&&n("overall-rate-envelope",`overall ${Math.round(l.overallCharsPerSec.median)} chars/s exceeds envelope ${m.max} for model size`,"reject",i.cellId),l.ttftMs&&l.ttftMs.median<1&&n("ttft-implausible",`median TTFT ${l.ttftMs.median}ms < 1ms`,"reject",i.cellId),o!=null&&o>=4){let d=o/1e3,g=0,h=0;for(let u of i.iterations)for(let f of u.chunks)h++,Math.abs(f.t/d-Math.round(f.t/d))>.01&&g++;h>=20&&g/h>.5&&n("timer-grid",`${g}/${h} chunk timestamps off the ${o}us timer grid`,"warn",i.cellId);}}else if(i.quality?.taskId.startsWith("tinymmlu")&&i.quality.outputs){let{outputs:l,details:c,score:m,n:d}=i.quality;if(l.length!==d||!c||c.length!==d)n("quality-outputs-mismatch","quality outputs/details length disagrees with n","reject",i.cellId);else {let g=0,h=true;for(let u=0;u<d;u++){let f=O[u];if(!f)break;let p=G(l[u],f.choices)===f.answer?1:0;g+=p,p!==c[u]&&(h=false);}(!h||Math.abs(g/d-m)>1e-9)&&n("quality-details-mismatch",`submitted MMLU score ${m} disagrees with recompute ${g/d} from raw outputs`,"reject",i.cellId);}}else if(i.iterations.length>0){let l=K(i);l.batchTextsPerSec&&l.batchTextsPerSec.median>pt&&n("embed-rate-envelope",`embedding throughput ${Math.round(l.batchTextsPerSec.median)} texts/s exceeds envelope`,"reject",i.cellId),l.singleLatencyMs&&l.singleLatencyMs.median<.05&&n("embed-latency-implausible","sub-50us embedding latency","reject",i.cellId);}}let r=e.environment.gpu.vendor?.toLowerCase()??"",a=e.environment.os.platform.toLowerCase();r==="apple"&&a.includes("windows")&&n("env-cross-field","Apple GPU adapter with Windows platform","reject");let s=[e.environment.gpu.vendor,e.environment.gpu.architecture,e.environment.gpu.device,e.environment.gpu.description,e.environment.webglRenderer].filter(Boolean).join(" ");if(gt.some(i=>i.test(s))){let i=e.cells.some(l=>l.status==="ok"&&/webgpu|^gpu$/.test(l.resolvedBackend));n("software-renderer",`GPU identity matches a software/virtual renderer: "${s.slice(0,120)}"`,i?"reject":"warn");}return t}function bt(e){let t=Ee(e);if(t.length>0)return {ok:false,shapeErrors:t,flags:[],summaries:[]};let n=q(e),o=Ce(e);if(e.clientSummaries){let r=new Map(n.map(a=>[a.cellId,a]));for(let a of e.clientSummaries){let s=r.get(a.cellId);if(s)for(let i of ["ttftMs","decodeCharsPerSec","totalMs","overallCharsPerSec","singleLatencyMs","batchTextsPerSec"]){let l=a[i]?.median,c=s[i]?.median;l!==void 0&&c!==void 0&&c!==0&&Math.abs(l-c)/Math.abs(c)>.01&&o.push({code:"client-summary-disagrees",cellId:a.cellId,message:`${i} client median ${l} vs recomputed ${c}`,severity:"reject"});}}}return {ok:o.every(r=>r.severity!=="reject"),shapeErrors:[],flags:o,summaries:n}}async function yt(e){let{policy:t,hooks:n,abortSignal:o}=e,r=new N;await r.attach(),r.record("suite-start",e.suite);let a=z(),s=[];try{n?.onPhase?.("environment");let i=await te({userReportedDevice:e.userReportedDevice});n?.onEnvironment?.(i),n?.onPhase?.("fingerprint"),T(o);let l=e.skipFingerprint?null:await ne(),c=a!=="none"?await B():null,m=wt(J(e.cells)),d=e.cells.length,g=0;for(let u of m){T(o);let f=await vt(u,{...e,trace:r,memApi:a,baselineMemory:c,cellIndexRef:()=>g++,totalCells:d});s.push(...f),r.record("cooldown-start"),await H(t.cooldownMs,o).catch(p=>{if(p.name==="AbortError")throw p}),t.pressureGate&&await At(r,t.pressureGateTimeoutMs,o),r.record("cooldown-end");}r.record("suite-end");let h={protocol:C,schemaVersion:2,runId:Mt(),createdAt:new Date().toISOString(),harness:e.harness,suite:e.suite,environment:i,fingerprint:l,cells:s,events:[...r.all]};return h.clientSummaries=q(h,t.highVarianceCv),h}finally{await r.dispose();}}function wt(e){let t=new Map;for(let n of e){let o=`${n.model.runtimeId}/${n.model.benchModelId}/${n.model.providerModelId}`,r=t.get(o);r||(r={key:o,model:n.model,workloads:[],skipped:[]},t.set(o,r)),n.skipReason?r.skipped.push({workload:n.workload,reason:n.skipReason}):r.workloads.push(n.workload);}return [...t.values()]}async function vt(e,t){let{model:n}=e,o=n.task==="embedding",r=o?t.embedAdapters.get(n.runtimeId):t.llmAdapters.get(n.runtimeId),a=[],s=h=>({cellId:`${n.runtimeId}/${n.benchModelId}/${h.id}`,runtimeId:n.runtimeId,runtimeVersion:r?.runtimeVersion,model:n,workloadId:h.id,workloadKind:h.kind,resolvedBackend:"unknown",load:null,iterations:[],status:"skipped"});for(let{workload:h,reason:u}of e.skipped){let f=s(h);f.invalidReasons=[u],a.push(j(f,t));}if(e.workloads.length===0)return a;if(!r){for(let h of e.workloads){let u=s(h);u.invalidReasons=[`no adapter registered for ${n.runtimeId}`],a.push(j(u,t));}return a}let i=await r.isAvailable();if(!i.ok){for(let h of e.workloads){let u=s(h);u.invalidReasons=[`runtime unavailable: ${i.reason??"unknown"}`],a.push(j(u,t));}return a}let l=null,c=null,m,d=null;try{T(t.abortSignal);let h=await r.isModelCached(n),u=[],f=b(),p=`${n.runtimeId}/${n.benchModelId}/${e.workloads[0].id}`;l=await r.load(n,{abortSignal:t.abortSignal,onProgress:S=>{typeof S.pct=="number"&&(u.length===0||S.pct-u[u.length-1].pct>=2)&&u.push({t:b(),pct:Math.round(S.pct*100)/100}),t.hooks?.onLoadProgress?.(p,S.pct);}});let w=b();if(c={cached:h,startT:f,endT:w,progress:u.length>0?It(u,50):void 0,declaredBytes:n.sizeBytes},t.memApi!=="none"&&(d=await B()),t.policy.warmupRuns>0){let S=b();for(let M=0;M<t.policy.warmupRuns;M++)T(t.abortSignal),o?await l.model.doEmbed({values:["warmup probe"],abortSignal:t.abortSignal}):await Be(l.model,{prompt:"Reply with the single word: ready",maxTokens:4,temperature:0},t.abortSignal);m=b()-S;}}catch(h){if(h.name==="AbortError")throw l&&await U(l),h;let u=t.memApi!=="none"?await B(5e3):null;for(let f of e.workloads){let p=s(f);p.status="error",p.load=c,p.error=Le(h),t.memApi!=="none"&&(p.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:d??void 0,atError:u??void 0}),a.push(j(p,t));}return l&&await U(l),a}let g=false;for(let h of e.workloads){T(t.abortSignal);let u=s(h);u.resolvedBackend=l.resolvedBackend,g||(u.load=c,u.warmupMs=m,g=true);let f=t.cellIndexRef();t.hooks?.onCellStart?.(u.cellId,f,t.totalCells);try{switch(h.kind){case "llm-generate":await kt(u,l,h,t);break;case "embed-single":case "embed-batch":await St(u,l,h,t);break;case "quality-mmlu":{let p=h.items;u.quality=await se(l.model,p,{abortSignal:t.abortSignal,onProgress:w=>t.hooks?.onIteration?.(u.cellId,w,p),promptSuffix:n.qualityPromptSuffix}),u.status="ok";break}case "quality-sts":{let p=h.items;u.quality=await ie(l.model,p,{abortSignal:t.abortSignal,onProgress:w=>t.hooks?.onIteration?.(u.cellId,w,p)}),u.status="ok";break}}}catch(p){if(p.name==="AbortError")throw await U(l),p;u.status="error",u.error=Le(p);}if(t.memApi!=="none"&&(u.status==="ok"||u.status==="error")){let p=await B(5e3);u.memory={api:t.memApi,baseline:t.baselineMemory??void 0,postLoad:d??void 0,...u.status==="ok"?{postRun:p??void 0}:{atError:p??void 0}};}a.push(j(u,t));}if(await U(l),t.policy.measureWarmReload&&c?.cached===false)try{T(t.abortSignal);let h=b(),u=await r.load(n,{abortSignal:t.abortSignal}),f=b();await U(u);let p={cellId:`${n.runtimeId}/${n.benchModelId}/warm-reload`,runtimeId:n.runtimeId,runtimeVersion:r.runtimeVersion,model:n,workloadId:"warm-reload",workloadKind:"llm-generate",resolvedBackend:u.resolvedBackend,load:{cached:!0,startT:h,endT:f,declaredBytes:n.sizeBytes},iterations:[],status:"ok"};a.push(j(p,t));}catch(h){if(h.name==="AbortError")throw h}return a}async function kt(e,t,n,o){let r=[];for(let s=0;s<o.policy.timedRuns;s++){T(o.abortSignal),o.hooks?.onIteration?.(e.cellId,s+1,o.policy.timedRuns);let i=[];o.trace.isHidden&&i.push("started-hidden");let l=Q(o.trace),c=b(),{chunks:m,text:d,providerUsage:g,finishReason:h}=await Be(t.model,{prompt:n.prompt,systemPrompt:n.systemPrompt,maxTokens:n.maxTokens,temperature:n.temperature},o.abortSignal),u=b();Q(o.trace)>l&&i.push("hidden-during-run"),d.length<_&&i.push("degenerate-output"),r.push({startT:c,chunks:m,endT:u,text:d,providerUsage:g?{...g,fidelity:Z[e.runtimeId]}:void 0,finishReason:h,gates:i});}e.iterations=r;let a=r.some(s=>s.gates.length>0);if(e.status=a?"invalid":"ok",a){let s=new Set;for(let i of r)for(let l of i.gates)s.add(l==="degenerate-output"?`degenerate output: fewer than ${_} generated chars in a timed iteration`:"validity gate fired during a timed region");e.invalidReasons=[...s];}}async function St(e,t,n,o){let r=[];for(let s=0;s<o.policy.timedRuns;s++){T(o.abortSignal),o.hooks?.onIteration?.(e.cellId,s+1,o.policy.timedRuns);let i=[];o.trace.isHidden&&i.push("started-hidden");let l=Q(o.trace),c=b(),{embeddings:m}=await t.model.doEmbed({values:n.texts,abortSignal:o.abortSignal}),d=b();Q(o.trace)>l&&i.push("hidden-during-run"),r.push({startT:c,endT:d,count:n.texts.length,dimensions:m[0]?.length??t.model.dimensions,gates:i});}e.iterations=r;let a=r.some(s=>s.gates.length>0);e.status=a?"invalid":"ok",a&&(e.invalidReasons=["validity gate fired during a timed region"]);}async function Be(e,t,n){let o=[],r="",a,s;if(e.doStream)for await(let i of e.doStream({...t,abortSignal:n})){let l=b();i.text.length>0&&(o.push({t:l,c:i.text.length}),r+=i.text),i.done&&(a=i.usage,s=i.finishReason);}else {let i=await e.doGenerate({...t,abortSignal:n}),l=b();r=i.text,o.push({t:l,c:i.text.length}),a=i.usage,s=i.finishReason;}return {chunks:o,text:r,providerUsage:a,finishReason:s}}function Q(e){let t=0;for(let n of e.all)n.type==="visibility-hidden"&&t++;return t}async function At(e,t,n){let o=b()+t;for(;b()<o;){let r=e.pressureState;if(r===void 0||r==="nominal"||r==="fair")return;await H(1e3,n);}}function It(e,t){if(e.length<=t)return e;let n=[],o=(e.length-1)/(t-1);for(let r=0;r<t;r++)n.push(e[Math.round(r*o)]);return n}var xt=4e3;function Le(e){let t=e,n=t?.cause,o=n instanceof Error?n.message:typeof n=="string"?n:void 0,r=n instanceof Error&&n.name&&n.name!=="Error"?n.name:void 0,a=n instanceof Error&&typeof n.stack=="string"&&n.stack.length>0?n.stack.slice(0,xt):void 0;return {name:t?.name??"Error",message:t?.message??String(e),...o!==void 0?{cause:o}:{},...r?{causeName:r}:{},...a?{causeStack:a}:{}}}function j(e,t){return t.hooks?.onCellFinish?.(e),e}async function U(e){try{await e.dispose();}catch{}}function T(e){if(e?.aborted)throw E()}function Mt(){let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID();let t=new Uint8Array(16);if(e?.getRandomValues)e.getRandomValues(t);else for(let o=0;o<16;o++)t[o]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return `${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function qe(e){return le(e)}function le(e){if(e===null||typeof e=="number"||typeof e=="boolean"||typeof e=="string")return JSON.stringify(e);if(typeof e>"u")return "null";if(Array.isArray(e))return `[${e.map(t=>le(t)).join(",")}]`;if(typeof e=="object")return `{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[o])=>n<o?-1:n>o?1:0).map(([n,o])=>`${JSON.stringify(n)}:${le(o)}`).join(",")}}`;throw new TypeError(`canonicalJson: unsupported value type ${typeof e}`)}async function je(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("Web Crypto (crypto.subtle) is not available in this environment");let n=new TextEncoder().encode(e),o=await t.digest("SHA-256",n);return [...new Uint8Array(o)].map(r=>r.toString(16).padStart(2,"0")).join("")}async function We(e){let{digest:t,...n}=e;return je(qe(n))}async function Rt(e){return e.digest?await We(e)===e.digest:false}function de(e){let t=e.environment,n=t.gpu.available?[t.gpu.vendor??"gpu",t.gpu.architecture].filter(Boolean).join("-"):"no-webgpu";return [t.os.platform.toLowerCase().replace(/\s+/g,"-"),n].join("/")}var De=3;function Tt(e,t=De){let n=new Map;for(let r of e){let a=de(r),s=r.clientSummaries??q(r),i=new Map(s.map(l=>[l.cellId,l]));for(let l of r.cells){if(l.status!=="ok")continue;let c=i.get(l.cellId);if(!c)continue;let m=[a,l.runtimeId,l.model.benchModelId,l.workloadId].join("|"),d=n.get(m);d||(d={row:{deviceClass:a,runtimeId:l.runtimeId,benchModelId:l.model.benchModelId,modelName:l.model.displayName,workloadId:l.workloadId,resolvedBackends:[],browsers:[],highVariance:false},ttft:[],decode:[],overall:[],single:[],batch:[],loadCold:[],loadWarm:[],quality:[],parseRate:[],runIds:new Set},n.set(m,d)),d.runIds.add(r.runId),Ne(d.row.resolvedBackends,l.resolvedBackend),Ne(d.row.browsers,r.environment.browser.name),d.row.highVariance||=c.highVariance,c.ttftMs&&d.ttft.push(c.ttftMs.median),c.decodeCharsPerSec&&d.decode.push(c.decodeCharsPerSec.median),c.overallCharsPerSec&&d.overall.push(c.overallCharsPerSec.median),c.singleLatencyMs&&d.single.push(c.singleLatencyMs.median),c.batchTextsPerSec&&d.batch.push(c.batchTextsPerSec.median),c.loadMs!==void 0&&(c.loadCached?d.loadWarm:d.loadCold).push(c.loadMs),c.qualityScore!==void 0&&d.quality.push(c.qualityScore),c.qualityParseRate!==void 0&&d.parseRate.push(c.qualityParseRate);}}let o=[];for(let r of n.values())o.push({...r.row,submissions:r.runIds.size,ttftMs:x(r.ttft),decodeCharsPerSec:x(r.decode),overallCharsPerSec:x(r.overall),singleLatencyMs:x(r.single),batchTextsPerSec:x(r.batch),loadColdMs:x(r.loadCold),loadWarmMs:x(r.loadWarm),qualityScore:x(r.quality),qualityParseRate:x(r.parseRate),provisional:r.runIds.size<t});return o.sort((r,a)=>r.deviceClass.localeCompare(a.deviceClass)||r.benchModelId.localeCompare(a.benchModelId)||r.runtimeId.localeCompare(a.runtimeId)||r.workloadId.localeCompare(a.workloadId)),o}function Ne(e,t){t&&!e.includes(t)&&e.push(t);}function x(e){return e.length>0?P($(e)):void 0}function P(e){return Math.round(e*100)/100}function ce(e){let t=e==null?"":String(e);return /[",\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function _t(e){let n=[["deviceClass","runtimeId","benchModelId","modelName","workloadId","submissions","ttftMs","decodeCharsPerSec","overallCharsPerSec","singleLatencyMs","batchTextsPerSec","loadColdMs","loadWarmMs","qualityScore","qualityParseRate","resolvedBackends","browsers","highVariance","provisional"].join(",")];for(let o of e)n.push([o.deviceClass,o.runtimeId,o.benchModelId,o.modelName,o.workloadId,o.submissions,o.ttftMs,o.decodeCharsPerSec,o.overallCharsPerSec,o.singleLatencyMs,o.batchTextsPerSec,o.loadColdMs,o.loadWarmMs,o.qualityScore,o.qualityParseRate,o.resolvedBackends.join(";"),o.browsers.join(";"),o.highVariance,o.provisional].map(ce).join(","));return n.join(`
35
35
  `)+`
36
- `}function _t(e){let o=[["runId","createdAt","suite","deviceClass","browser","browserVersion","os","gpuVendor","gpuArchitecture","cores","deviceMemoryGB","crossOriginIsolated","fingerprintMflops","runtimeId","runtimeVersion","benchModelId","providerModelId","quantization","sizeBytes","workloadId","resolvedBackend","iteration","ttftMs","decodeCharsPerSec","generatedChars","overallCharsPerSec","streamIncremental","durationMs","loadMs","loadCached","status"].join(",")];for(let n of e){let r=n.environment,a=[n.runId,n.createdAt,n.suite,de(n),r.browser.name,r.browser.version,r.os.platform,r.gpu.vendor??"",r.gpu.architecture??"",r.hardware.cores??"",r.hardware.deviceMemoryGB??"",r.flags.crossOriginIsolated,n.fingerprint?P(n.fingerprint.mflops):""];for(let s of n.cells){let i=s.load?P(s.load.endT-s.load.startT):"",l=s.load?String(s.load.cached):"",c=[s.runtimeId,s.runtimeVersion??"",s.model.benchModelId,s.model.providerModelId,s.model.quantization??"",s.model.sizeBytes??"",s.workloadId,s.resolvedBackend];if(s.iterations.length===0){o.push([...a,...c,"","","","","","","",i,l,s.status].map(ce).join(","));continue}s.iterations.forEach((u,d)=>{let g="",h="",m="",f="",p="";if("chunks"in u){let w=u.chunks.reduce((I,j)=>I+j.c,0);m=String(w);let S=u.endT-u.startT;S>0&&w>0&&(f=String(P(w/S*1e3)));let M=Y(u);p=String(M);let R=u.chunks.find(I=>I.c>0);if(M&&R){g=String(P(R.t-u.startT));let I=u.chunks[u.chunks.length-1],j=w-R.c,ue=I.t-R.t;ue>0&&(h=String(P(j/ue*1e3)));}}o.push([...a,...c,d+1,g,h,m,f,p,P(u.endT-u.startT),i,l,s.status].map(ce).join(","));});}}return o.join(`
36
+ `}function Et(e){let n=[["runId","createdAt","suite","deviceClass","browser","browserVersion","os","gpuVendor","gpuArchitecture","cores","deviceMemoryGB","crossOriginIsolated","fingerprintMflops","runtimeId","runtimeVersion","benchModelId","providerModelId","quantization","sizeBytes","workloadId","resolvedBackend","iteration","ttftMs","decodeCharsPerSec","generatedChars","overallCharsPerSec","streamIncremental","durationMs","loadMs","loadCached","status"].join(",")];for(let o of e){let r=o.environment,a=[o.runId,o.createdAt,o.suite,de(o),r.browser.name,r.browser.version,r.os.platform,r.gpu.vendor??"",r.gpu.architecture??"",r.hardware.cores??"",r.hardware.deviceMemoryGB??"",r.flags.crossOriginIsolated,o.fingerprint?P(o.fingerprint.mflops):""];for(let s of o.cells){let i=s.load?P(s.load.endT-s.load.startT):"",l=s.load?String(s.load.cached):"",c=[s.runtimeId,s.runtimeVersion??"",s.model.benchModelId,s.model.providerModelId,s.model.quantization??"",s.model.sizeBytes??"",s.workloadId,s.resolvedBackend];if(s.iterations.length===0){n.push([...a,...c,"","","","","","","",i,l,s.status].map(ce).join(","));continue}s.iterations.forEach((m,d)=>{let g="",h="",u="",f="",p="";if("chunks"in m){let w=m.chunks.reduce((I,W)=>I+W.c,0);u=String(w);let S=m.endT-m.startT;S>0&&w>0&&(f=String(P(w/S*1e3)));let M=Y(m);p=String(M);let R=m.chunks.find(I=>I.c>0);if(M&&R){g=String(P(R.t-m.startT));let I=m.chunks[m.chunks.length-1],W=w-R.c,ue=I.t-R.t;ue>0&&(h=String(P(W/ue*1e3)));}}n.push([...a,...c,d+1,g,h,u,f,p,P(m.endT-m.startT),i,l,s.status].map(ce).join(","));});}}return n.join(`
37
37
  `)+`
38
- `}export{C as BENCH_PROTOCOL_VERSION,L as BENCH_SCHEMA_VERSION,pe as EMBED_WORKLOADS,X as GENERATION_BUDGET,De as HEADLINE_MIN_SUBMISSIONS,he as LLM_WORKLOADS,_ as MIN_GENERATED_CHARS,Me as MMLU_MAX_TOKENS,Re as MMLU_OUTPUT_CAP,mt as PLAUSIBILITY_RULES_VERSION,ge as QUALITY_WORKLOADS,F as RUNTIME_EXECUTION_ORDER,ze as RUN_POLICIES,_e as STREAM_COHERENCE_MIN_SPAN_RATIO,re as STSB_SUBSET,D as TINY_MMLU,W as TraceRecorder,Z as USAGE_FIDELITY,He as WORKLOADS_BY_ID,Rt as aggregateRuns,qe as canonicalJson,te as captureEnvironment,Ce as checkPlausibility,We as computeRunDigest,ye as deriveDeviceType,be as detectEngine,ke as detectWasmFeatures,de as deviceClassOf,Te as formatMMLUPrompt,lt as geomean,b as hrNow,ee as inferTimerResolutionUs,Y as isIncrementalStream,N as mean,$ as median,z as memoryApiAvailable,J as orderCells,ve as parseGpuModel,G as parseMMLUAnswer,fe as parseUserAgent,V as quantile,we as resolveGpuModel,Tt as rowsToCSV,yt as runBenchmarkSuite,ne as runFingerprint,se as runMMLUFidelity,ie as runSTSQuality,_t as runsToLongCSV,B as sampleMemoryBytes,je as sha256Hex,H as sleep,oe as spearman,xe as stddev,A as summarize,K as summarizeCell,q as summarizeRun,Ee as validateRunShape,bt as validateSubmission,Mt as verifyRunDigest};//# sourceMappingURL=index.js.map
38
+ `}export{C as BENCH_PROTOCOL_VERSION,L as BENCH_SCHEMA_VERSION,pe as EMBED_WORKLOADS,X as GENERATION_BUDGET,De as HEADLINE_MIN_SUBMISSIONS,he as LLM_WORKLOADS,_ as MIN_GENERATED_CHARS,Me as MMLU_MAX_TOKENS,Re as MMLU_OUTPUT_CAP,mt as PLAUSIBILITY_RULES_VERSION,ge as QUALITY_WORKLOADS,F as RUNTIME_EXECUTION_ORDER,ze as RUN_POLICIES,_e as STREAM_COHERENCE_MIN_SPAN_RATIO,re as STSB_SUBSET,O as TINY_MMLU,N as TraceRecorder,Z as USAGE_FIDELITY,He as WORKLOADS_BY_ID,Tt as aggregateRuns,qe as canonicalJson,te as captureEnvironment,Ce as checkPlausibility,We as computeRunDigest,ye as deriveDeviceType,be as detectEngine,ke as detectWasmFeatures,de as deviceClassOf,Te as formatMMLUPrompt,lt as geomean,b as hrNow,ee as inferTimerResolutionUs,Y as isIncrementalStream,D as mean,$ as median,z as memoryApiAvailable,J as orderCells,ve as parseGpuModel,G as parseMMLUAnswer,fe as parseUserAgent,V as quantile,we as resolveGpuModel,_t as rowsToCSV,yt as runBenchmarkSuite,ne as runFingerprint,se as runMMLUFidelity,ie as runSTSQuality,Et as runsToLongCSV,B as sampleMemoryBytes,je as sha256Hex,H as sleep,oe as spearman,xe as stddev,A as summarize,K as summarizeCell,q as summarizeRun,Ee as validateRunShape,bt as validateSubmission,Rt as verifyRunDigest};//# sourceMappingURL=index.js.map
39
39
  //# sourceMappingURL=index.js.map