feat: Add gallery presets, MultiDisplay support, and viewport tests

- Add ~20 gallery presets covering sources, effects, cameras, displays
- Add MultiDisplay support with --display multi:terminal,pygame syntax
- Fix ViewportFilterStage to recompute layout on viewport_width change
- Add benchmark.py module for hook-based performance testing
- Add viewport resize tests to test_viewport_filter_performance.py
This commit is contained in:
2026-03-17 01:24:15 -07:00
parent 57de835ae0
commit 05d261273e
8 changed files with 453 additions and 128 deletions

View File

@@ -8,84 +8,246 @@
# - ~/.config/mainline/presets.toml
# - ./presets.toml (local override)
[presets.demo]
description = "Demo mode with effect cycling and camera modes"
# ============================================
# DATA SOURCE GALLERY
# ============================================
[presets.gallery-sources]
description = "Gallery: Headlines data source"
source = "headlines"
display = "pygame"
camera = "scroll"
effects = ["noise", "fade", "glitch", "firehose"]
camera = "feed"
effects = []
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
camera_speed = 1.0
firehose_enabled = true
[presets.poetry]
description = "Poetry feed with subtle effects"
[presets.gallery-sources-poetry]
description = "Gallery: Poetry data source"
source = "poetry"
display = "pygame"
camera = "scroll"
camera = "feed"
effects = ["fade"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
camera_speed = 0.5
[presets.border-test]
description = "Test border rendering with empty buffer"
source = "empty"
display = "terminal"
camera = "scroll"
effects = ["border"]
viewport_width = 80
viewport_height = 24
camera_speed = 1.0
firehose_enabled = false
border = false
[presets.websocket]
description = "WebSocket display mode"
source = "headlines"
display = "websocket"
camera = "scroll"
effects = ["noise", "fade", "glitch"]
viewport_width = 80
viewport_height = 24
camera_speed = 1.0
firehose_enabled = false
[presets.sixel]
description = "Sixel graphics display mode"
source = "headlines"
display = "sixel"
camera = "scroll"
effects = ["noise", "fade", "glitch"]
viewport_width = 80
viewport_height = 24
camera_speed = 1.0
firehose_enabled = false
[presets.firehose]
description = "High-speed firehose mode"
source = "headlines"
display = "pygame"
camera = "scroll"
effects = ["noise", "fade", "glitch", "firehose"]
viewport_width = 80
viewport_height = 24
camera_speed = 2.0
firehose_enabled = true
[presets.pipeline-inspect]
description = "Live pipeline introspection with DAG and performance metrics"
[presets.gallery-sources-pipeline]
description = "Gallery: Pipeline introspection"
source = "pipeline-inspect"
display = "pygame"
camera = "scroll"
effects = ["crop"]
effects = []
camera_speed = 0.3
viewport_width = 100
viewport_height = 35
camera_speed = 0.3
firehose_enabled = false
# Sensor configuration (for future use with param bindings)
[presets.gallery-sources-empty]
description = "Gallery: Empty source (for border tests)"
source = "empty"
display = "terminal"
camera = "feed"
effects = ["border"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
# ============================================
# EFFECT GALLERY
# ============================================
[presets.gallery-effect-noise]
description = "Gallery: Noise effect"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["noise"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-effect-fade]
description = "Gallery: Fade effect"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["fade"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-effect-glitch]
description = "Gallery: Glitch effect"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["glitch"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-effect-firehose]
description = "Gallery: Firehose effect"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["firehose"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-effect-hud]
description = "Gallery: HUD effect"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["hud"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-effect-tint]
description = "Gallery: Tint effect"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["tint"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-effect-border]
description = "Gallery: Border effect"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["border"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-effect-crop]
description = "Gallery: Crop effect"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["crop"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
# ============================================
# CAMERA GALLERY
# ============================================
[presets.gallery-camera-feed]
description = "Gallery: Feed camera (rapid single-item)"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["noise"]
camera_speed = 1.0
viewport_width = 80
viewport_height = 24
[presets.gallery-camera-scroll]
description = "Gallery: Scroll camera (smooth)"
source = "headlines"
display = "pygame"
camera = "scroll"
effects = ["noise"]
camera_speed = 0.3
viewport_width = 80
viewport_height = 24
[presets.gallery-camera-horizontal]
description = "Gallery: Horizontal camera"
source = "headlines"
display = "pygame"
camera = "horizontal"
effects = ["noise"]
camera_speed = 0.5
viewport_width = 80
viewport_height = 24
[presets.gallery-camera-omni]
description = "Gallery: Omni camera"
source = "headlines"
display = "pygame"
camera = "omni"
effects = ["noise"]
camera_speed = 0.5
viewport_width = 80
viewport_height = 24
[presets.gallery-camera-floating]
description = "Gallery: Floating camera"
source = "headlines"
display = "pygame"
camera = "floating"
effects = ["noise"]
camera_speed = 1.0
viewport_width = 80
viewport_height = 24
[presets.gallery-camera-bounce]
description = "Gallery: Bounce camera"
source = "headlines"
display = "pygame"
camera = "bounce"
effects = ["noise"]
camera_speed = 1.0
viewport_width = 80
viewport_height = 24
# ============================================
# DISPLAY GALLERY
# ============================================
[presets.gallery-display-terminal]
description = "Gallery: Terminal display"
source = "headlines"
display = "terminal"
camera = "feed"
effects = ["noise"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-display-pygame]
description = "Gallery: Pygame display"
source = "headlines"
display = "pygame"
camera = "feed"
effects = ["noise"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-display-websocket]
description = "Gallery: WebSocket display"
source = "headlines"
display = "websocket"
camera = "feed"
effects = ["noise"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
[presets.gallery-display-multi]
description = "Gallery: MultiDisplay (terminal + pygame)"
source = "headlines"
display = "multi:terminal,pygame"
camera = "feed"
effects = ["noise"]
camera_speed = 0.1
viewport_width = 80
viewport_height = 24
# ============================================
# SENSOR CONFIGURATION
# ============================================
[sensors.mic]
enabled = false
threshold_db = 50.0
@@ -95,7 +257,10 @@ enabled = false
waveform = "sine"
frequency = 1.0
# Effect configurations
# ============================================
# EFFECT CONFIGURATIONS
# ============================================
[effect_configs.noise]
enabled = true
intensity = 1.0