# From the localFirstTools directory
open apps/ai-tools/recursive-self-portrait.htmlOr use a local server:
python3 -m http.server 8000
# Navigate to: http://localhost:8000/apps/ai-tools/recursive-self-portrait.html- Click "Begin Observation" button
- Move your cursor around the viewport
- After 11+ movements, the neural network can begin training
- Check the "Use Neural Prediction" checkbox
- Watch the "Neural Confidence" meter start at 0%
- Continue moving your cursor
- Observe the confidence increase as the network trains
- Goal: See how well neural network learns simple patterns
- Action: Move cursor in straight lines
- Expected: Neural confidence should reach 70%+ quickly (within 100 moves)
- Observation: Prediction trails should closely follow actual cursor
- Goal: Test pattern recognition on curves
- Action: Move cursor in circles
- Expected: Neural adapts within 50-100 moves, confidence 60-80%
- Observation: Ghost cursors should predict circular trajectory
- Goal: Compare neural vs heuristic on unpredictable behavior
- Action: Move cursor randomly and chaotically
- Expected: Neural confidence stays lower (30-50%)
- Observation: Heuristic may perform better (toggle to compare)
- Goal: Test adaptation to behavioral changes
- Action:
- Move in circles (let neural train to 70%+)
- Suddenly switch to straight lines
- Expected: Confidence may drop temporarily, then recover
- Observation: See "Adjusting prediction model" in log
- "Neural Confidence" shows percentage (0-100%)
- "Prediction Mode" shows "Neural" when checkbox is checked
- "Prediction Mode" shows "Heuristic" when checkbox is unchecked
- Confidence updates in real-time as you move
- Canvas appears between fingerprint and behavior log
- Shows network architecture: Input → Hidden → Hidden → Hidden → Output
- Neurons light up as you move cursor
- Brighter neurons = higher activation
- Purple output neurons when in neural mode
- Connection lines visible between layers
- Log entry when neural network initializes
- Log entries when switching prediction modes
- Existing log entries still work (movement style, predictions, etc.)
- Open browser dev tools (F12)
- Go to Performance tab
- Start recording
- Move cursor rapidly while in neural mode
- Stop recording
- Check frame rate stays near 60 FPS
Expected: Should maintain 55-60 FPS even with neural training active
- Enable neural prediction
- Note time when confidence is 0%
- Move cursor in consistent pattern
- Time until confidence reaches 70%
Expected: ~100-200 cursor movements (10-30 seconds of active movement)
- Enable neural mode
- Move very slowly (lazy movement style)
- Neural should still train (confidence increases slowly)
- Toggle neural mode on/off rapidly
- Should not crash or freeze
- Mode indicator updates correctly
- Set depth slider to 12 (maximum)
- Enable neural mode
- Both prediction methods should work at all depths
- Run for 500+ actions
- Neural confidence should stabilize
- Performance should remain consistent
- Webcam integration still works
- Sound effects still work
- Heat map still works
- Glitch effects still work
- Meta-commentary still appears
- Export/import still works
- Behavioral fingerprint still updates
Test in each browser:
- Chrome/Chromium
- Firefox
- Safari
- Edge
Expected: All features work in all modern browsers
If neural network isn't working:
-
Check console for errors
- Open dev tools (F12) → Console tab
- Look for JavaScript errors
-
Verify initialization
- Check behavior log for "Neural network initialized: 40→20→15→10→2"
- If missing, neural toggle may not be triggering init
-
Check data collection
- Move cursor at least 11 times before expecting training
- Verify "Actions Recorded" counter in stats panel
-
Canvas not showing
- Scroll sidebar if neural canvas is off-screen
- Check if canvas element exists in dev tools → Elements tab
-
Confidence not increasing
- Ensure neural toggle is checked
- Move cursor more (need consistent movement pattern)
- Check if training function is being called (console.log)
When working correctly, you should see (open dev tools):
// No errors
// Optional: Can add console.logs to verify:
// - trainNeuralNetwork called every 3 mousemoves
// - visualizeNeuralNetwork called every 20 mousemoves
// - Neural confidence value updating
Take screenshots of:
- Stats panel showing neural confidence at 0%
- Stats panel showing neural confidence at 70%+
- Neural network visualization with neurons lit up
- Prediction trails in neural mode
- Prediction trails in heuristic mode (for comparison)
- Behavior log entries about neural network
- Network trains incrementally (no batch training)
- Only output layer weights update (for performance)
- Maximum 60 FPS during training
- Confidence based on MSE (may not reflect true accuracy)
- No weight persistence (resets on page reload)
The implementation is successful if:
- ✓ Neural toggle switches between modes
- ✓ Confidence meter updates in real-time
- ✓ Network visualization shows active neurons
- ✓ Predictions work in both modes
- ✓ Performance stays at ~60 FPS
- ✓ All existing features still work
- ✓ No JavaScript errors in console
Copy and paste into browser console for automated test:
// Automated neural network test
(async function testNeural() {
console.log('Starting neural network test...');
// Start observation
document.getElementById('startBtn').click();
await new Promise(r => setTimeout(r, 100));
// Simulate cursor movements
const viewport = document.getElementById('viewport');
const rect = viewport.getBoundingClientRect();
for (let i = 0; i < 50; i++) {
const x = rect.left + rect.width/2 + Math.cos(i/5) * 100;
const y = rect.top + rect.height/2 + Math.sin(i/5) * 100;
const event = new MouseEvent('mousemove', {
clientX: x,
clientY: y,
bubbles: true
});
viewport.dispatchEvent(event);
await new Promise(r => setTimeout(r, 50));
}
// Enable neural mode
document.getElementById('neuralToggle').checked = true;
document.getElementById('neuralToggle').dispatchEvent(new Event('change'));
console.log('Test complete. Check:');
console.log('- Neural Confidence should be > 0%');
console.log('- Prediction Mode should show "Neural"');
console.log('- Canvas should show network visualization');
})();If you find bugs or issues, report:
- Browser and version
- Steps to reproduce
- Console errors (if any)
- Screenshot of the issue
- Expected vs actual behavior
Happy testing! The neural network should demonstrate real-time learning of your cursor movement patterns while maintaining smooth 60 FPS performance.