app: fixture-mode session screen and a "Run benchmark" control
BenchFixture.kt/BenchNetwork.kt fake the backend for the bench build: a URLStreamHandlerFactory installed only under BuildConfig.FIXTURE_MODE answers TranscriptSource/EventStream's requests from an in-memory copy of the bundled fixture instead of opening a socket, so the fold, the paging and uniqueItems under test are the screen's real ones rather than a shortcut built for this. MainActivity opens straight onto that session when FIXTURE_MODE is set, with no enrollment and no permission prompts. BenchRun.kt drives the same scroll loop and streaming phase transcript-bench.sh/stream-bench.sh drive over ui-trace, but in-process (24 swipes through the real LazyListState, then 400 fixture events appended at 20/s through the real live-fold path), and adds process CPU time, peak RSS and battery current to the render report -- "unavailable" rather than a fabricated number where the device can't answer. "Run benchmark" sits beside the existing "Copy" in session settings, found by that exact label the way every other control here is (SessionSettingsDialog's onRunBenchmark, null on every build but bench). debugReport gained an optional `extra` section for this; empty and invisible on every other build's report. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
a6cb9a9082
commit
e6c884a0cd
7 files changed
+537
-1
No files matched your search
@@ -127,6 +127,13 @@ fun debugReport(
|
||||
frames: List<String>,
|
||||
accounting: List<String>,
|
||||
crash: String?,
|
||||
/**
|
||||
* P0's benchmark-only measurements (process CPU time, peak RSS, battery current) -- empty on
|
||||
* every path but [BenchRun.runP0Benchmark], which is the only caller that has them. A section
|
||||
* heading only appears when there is something to put under it, so an ordinary copy from the
|
||||
* render-report button reads exactly as it did before this existed.
|
||||
*/
|
||||
extra: List<String> = emptyList(),
|
||||
): String = buildString {
|
||||
appendLine("ai-app render report")
|
||||
appendLine(device)
|
||||
@@ -152,6 +159,11 @@ fun debugReport(
|
||||
appendLine("work since this was last copied:")
|
||||
val work = DebugStats.lines()
|
||||
if (work.isEmpty()) appendLine(" nothing recorded") else work.forEach { appendLine(it) }
|
||||
if (extra.isNotEmpty()) {
|
||||
appendLine()
|
||||
appendLine("bench:")
|
||||
extra.forEach { appendLine(it) }
|
||||
}
|
||||
}
|
||||
|
||||
/** Puts [text] on the clipboard under [label], which is what the system offers as its name. */
|
||||
|
||||
Reference in new issue
Block a user