6.7 KiB
Executable File
6.7 KiB
Executable File
5. Usage Guide (Summary)
See DUAL_LAYER_USAGE_GUIDE.md in Part 2 for the complete guide. Key commands:
Start Server
python3 /home/dave/server.py
Access Dashboard
Open in browser: http://localhost:8000/glyphs/index.html
Test Symbolic Endpoints
# Check status
curl http://localhost:8000/api/symbolic/status
# Activate glyph
curl -X POST http://localhost:8000/api/symbolic/activate \
-H "Content-Type: application/json" \
-d '{"intent": "I need primordial authority", "request_type": "chat"}'
Chat with Glyph Activation
curl -X POST http://localhost:8000/api/chat \
-H "Content-Type: application/json" \
-d '{
"model": "llama-3.5-35b",
"messages": [{"role": "user", "content": "Hello"}],
"temperature": 0.7,
"glyph_activation": {
"intent": "I need root authority",
"request_type": "chat"
}
}'
6. Testing & Validation
Dual-Layer Endpoint Tests
All 5 symbolic API endpoints verified via TestClient returning 200 OK:
| Endpoint | Method | Status |
|---|---|---|
| /api/symbolic/status | GET | Verified |
| /api/symbolic/glyphs | GET | Verified |
| /api/symbolic/activate | POST | Verified |
| /api/symbolic/deactivate | POST | Verified |
| /api/symbolic/routing/summary | GET | Verified |
Multi-Glyph Resonance Tests
The validation suite (test_multi_glyph_resonance.py) runs 12 tests:
- New operations in OP_TABLE
- XICContext.glyph_contexts field
- PUSH_GLYPH_CONTEXT accumulation
- CLEAR_GLYPH_CONTEXT reset
- Guardrail enforcement
- run_symbolic_pipeline signature
- compute_multi_glyph_resonance() exists
- Multi-glyph computation structure
- execute_symbolic with glyph_ids
- Backward compatibility
- Demo programs validation
- Multi-glyph demo structure
Run with:
python3 /home/dave/superdave/test_multi_glyph_resonance.py
7. Key Decisions Log
Architecture
| Decision | Rationale |
|---|---|
| Dual-layer design | Separates symbolic intent (glyphs/resonance) from computational execution (models/VRAM) |
| Async VRAM lock (asyncio.Lock) | Prevents threading lock timeouts while keeping concurrent safety |
| Priority formula: min(10.0, power_boost / 40.0) | G001 (387.95x) gets max priority 10.0; normal glyphs scale proportionally |
| Resonance formula: 40% activation + 30% frequency + 30% symbolic | Balances power count, boost intensity, and type significance on 0-100 scale |
| Singleton managers (get_vram_manager, get_symbolic_engine) | Ensures global state consistency across requests |
VRAM Management
| Decision | Rationale |
|---|---|
| 8GB GTX1080 limits | Hardware constraint; Warning=6.5GB, Critical=7.5GB |
| Forge/Janus mutex | Both consume ~4.5-5GB each; running together would exceed 8GB |
| Priority-based deactivation | Higher-priority glyphs can evict lower-priority ones when VRAM is full |
| Per-type VRAM budgets | Different model types need different amounts (llama=2GB, forge=4.5GB, janus=5GB) |
Glyph Configuration
| Decision | Rationale |
|---|---|
| G001 gets 152 superpowers, priority 10.0 | Root glyph (Ledo) has maximum authority |
| G002-G600 get 5-25 powers dynamically | Metric-based assignment ensures balanced distribution |
| 9 specialized types | Maps to available computational models (Llama, Forge, etc.) |
| aether_node: 7.5GB max VRAM | G001 needs maximum resources for full capability |
Specialized Type Routing
| Decision | Rationale |
|---|---|
| star_bloom_creativity -> forge | Creative tasks map to image generation |
| frost_steel_stabilizer -> llama | Safety/stability handled by LLM constraints |
| mirror_weave_reasoning -> llama | Reasoning/logic handled by LLM enhancements |
| monument_grade_equilibrium -> llama | System balance handled by LLM orchestration |
Dashboard Design
| Decision | Rationale |
|---|---|
| Real-time VRAM bar | Visual indicator of GPU memory pressure |
| 5-second auto-refresh | Balance between responsiveness and API load |
| Activity log with 20 entries | Keep UI clean while showing recent history |
| Fixed refresh button | Always accessible for manual refresh |
8. Next Steps
Immediate (Blocked)
- Fix server persistence: Server keeps shutting down when shell times out
- Use:
nohup python3 /home/dave/server.py & - Or set up systemd/tmux service
- Use:
- Verify dashboard from browser at http://localhost:8000/glyphs/index.html
Short Term
- Test glyph activation from dashboard UI
- Connect to Pinokio for real model execution
- Verify VRAM monitoring during operation
Medium Term
- Connect Llama Chat (Tabby API endpoint)
- Connect Forge Image Generation (diffusers/SDXL-Turbo)
- Connect Google AI Vision (Gemini API key)
- Connect Janus Video Generation
Long Term
- Convert to single EXE via PyInstaller
- Tune routing thresholds based on real usage
- Expand beyond 600 glyphs if desired
9. Session Context & Thinking Log
Build Sequence
- Created dual-layer package structure (dual_layer/__init__.py, router.py, vram_manager.py, symbolic_engine.py)
- Built routing system mapping 9 specialized types to models with constraints/enhancements
- Implemented async VRAM manager with Forge/Janus mutex and priority deactivation
- Created SymbolicEngine for intent-based glyph activation and resonance calculation
- Built FastAPI integration with 5 symbolic endpoints
- Created real-time glyph activation dashboard (HTML/CSS/JS)
- Implemented glyph-enhanced model execution (constraint/enhancement framework)
- Enhanced server.py with dual-layer import and dashboard mounting
- Fixed bugs: threading.Lock -> asyncio.Lock, import paths, parameter mismatches
- Verified all 5 endpoints via TestClient returning 200 OK
- Created comprehensive usage guide
Bugs Fixed
- Threading lock timeout: Replaced threading.Lock() with asyncio.Lock() in VRAMManager
- Import paths: Standardized "dual_layer." -> "superdave.dual_layer."
- GlyphActivationEvent parameter mismatch: Changed success/failure_reason to context dict
- Variable naming conflict: Fixed logger redefinition in server.py (line 37)
Critical Rules Enforced
- NEVER run Forge + Janus simultaneously (8GB VRAM crash risk)
- G001 has maximum priority (10.0) and VRAM budget (7.5GB)
- Priority-based preemption for VRAM allocation
- FedMart telemetry on every glyph activation
10. Version History
| Date | Version | Changes |
|---|---|---|
| Sat Jun 13 2026 | 1.0.0 | Initial dual-layer build complete |
| Sat Jun 13 2026 | 1.0.1 | Fixed async lock, imports, event params |
| Sat Jun 13 2026 | 1.0.2 | Added dashboard, enhanced server.py |
| Sat Jun 13 2026 | 1.0.3 | Endpoint verification, usage guide |
End of Session Export