Skip to content

Commit a0ce44a

Browse files
author
DavidQ
committed
Fix Phase 16 visibility calibration for samples 1602 and 1604 with shared 3D projection sanity<BUILD_PR_LEVEL_17_7_3D_VISIBILITY_CALIBRATION_AND_SANITY>
1 parent 49c03e0 commit a0ce44a

12 files changed

Lines changed: 288 additions & 232 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,38 @@ MODEL: GPT-5.3-codex
22
REASONING: high
33

44
COMMAND:
5-
Implement progressive 3D samples:
6-
- create 1602 maze navigation sample
7-
- create 1603 first-person walkthrough
8-
- create 1604 basic platformer (gravity/jump)
9-
- register in samples index
10-
- validate no regressions across all samples
5+
Create BUILD_PR_LEVEL_17_7_3D_VISIBILITY_CALIBRATION_AND_SANITY.
6+
7+
Goal:
8+
Fix the current Phase 16 visibility defect where sample 1602 and sample 1604 load and accept input but do not show usable 3D output.
9+
10+
Constraints:
11+
- one PR purpose only
12+
- smallest scoped valid change
13+
- no repo-wide scanning
14+
- no zip output from Codex
15+
- do not modify start_of_day
16+
- keep 2D and networking untouched
17+
- preserve samples/index.html unless a real correction is required
18+
19+
Implement:
20+
1. Inspect samples/phase-16/shared/threeDWireframe.js for camera-space forward, yaw/pitch sign, near-plane, and projection assumptions.
21+
2. Calibrate sample camera placement/framing in:
22+
- samples/phase-16/1602/MazeRunner3DScene.js
23+
- samples/phase-16/1604/Platformer3DBasicsScene.js
24+
3. Apply the smallest shared-path correction needed so 1601, 1602, and 1604 all render visible wireframe geometry.
25+
4. Add a minimal visibility sanity check for the affected Phase 16 samples if a lightweight existing test location already fits. Keep it surgical.
26+
27+
Validation:
28+
- verify 1601 visible on load
29+
- verify 1602 visible on load
30+
- verify 1604 visible on load
31+
- verify movement/input still works for 1602 and 1604
32+
- run targeted smoke only
33+
- write/update docs/dev/reports/validation_checklist.txt
34+
- write/update docs/dev/reports/change_summary.txt
35+
36+
Output:
37+
- modify repo files directly
38+
- do not create any zip
39+
- keep commit-ready changes minimal

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add progressive 3D samples 16021604 (navigation, FPS, platformer)<BUILD_PR_LEVEL_17_6_SAMPLES_1602_TO_1604_PROGRESSIVE>
1+
Fix Phase 16 visibility calibration for samples 1602 and 1604 with shared 3D projection sanity<BUILD_PR_LEVEL_17_7_3D_VISIBILITY_CALIBRATION_AND_SANITY>
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
Structured all 3D roadmap items into dependency-ordered execution layers
1+
Observed issue:
2+
- 1602 and 1604 load
3+
- canvas paints
4+
- input appears live
5+
- visible 3D geometry missing
6+
7+
Applied fix (minimal scope):
8+
- corrected pitch sign in 3D camera-space projection:
9+
- samples/phase-16/shared/threeDWireframe.js
10+
- samples/phase-16/1601/CubeExplorer3DScene.js (local duplicated projection path)
11+
- calibrated initial camera framing for affected samples:
12+
- samples/phase-16/1602/MazeRunner3DScene.js (camera height/depth/pitch)
13+
- samples/phase-16/1604/Platformer3DBasicsScene.js (camera yaw fallback alignment)
14+
- added surgical runtime sanity check:
15+
- tests/runtime/Phase16VisibilitySanity.test.mjs
16+
17+
Validation outcome:
18+
- PASS Phase16VisibilitySanity
19+
- PASS launch smoke (samples 1601-1604): PASS=4 FAIL=0
20+
- visibility restored for 1602 and 1604 while preserving 1601
21+
- input/movement confirmed for 1602 and 1604 via sanity test

docs/dev/reports/launch_smoke_report.md

Lines changed: 2 additions & 200 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
Validation report will be generated after execution.
1+
Phase 16 targeted visibility checklist
2+
[x] 1601 renders visible wireframe geometry on load
3+
[x] 1602 renders visible wireframe geometry on load
4+
[x] 1604 renders visible wireframe geometry on load
5+
[x] 1602 movement/input still functions
6+
[x] 1604 movement/input still functions
7+
[x] no 2D regression observed in targeted smoke
8+
[x] no networking regression observed in targeted smoke
9+
10+
Execution evidence:
11+
- PASS Phase16VisibilitySanity (wireframe visibility + movement/jump input checks for 1601/1602/1604)
12+
- Launch smoke targeted run: --samples --sample-range=1601-1604
13+
- Launch smoke result: PASS=4 FAIL=0 TOTAL=4
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# BUILD PR: 17.7 3D Visibility Calibration And Sanity
2+
3+
## Purpose
4+
Fix the current Phase 16 visibility failure where 1602 and 1604 boot, accept input, and paint the canvas, but do not display usable 3D geometry.
5+
6+
## Observed Runtime Symptom
7+
- Sample 1602 loads
8+
- Sample 1604 loads
9+
- Canvas paints
10+
- Input appears active
11+
- Visible 3D output is missing or effectively off-screen
12+
13+
## Grounded Diagnosis
14+
The failure pattern points to 3D framing/projection rather than boot/input:
15+
- scene lifecycle is alive
16+
- update loop is alive
17+
- input loop is alive
18+
- draw path is running
19+
- projected geometry is likely clipped, behind near plane, or landing off-canvas due to camera pose / pitch convention / focal calibration
20+
21+
## Scope
22+
- calibrate 3D camera framing for 1602 and 1604
23+
- correct pitch / projection assumptions if needed in shared 3D wireframe projection path
24+
- add a small visibility sanity contract for Phase 16 samples using the shared wireframe path
25+
- keep sample 1601 behavior intact unless required by the shared fix
26+
- keep 2D and networking untouched
27+
28+
## In Scope Files
29+
- samples/phase-16/shared/threeDWireframe.js
30+
- samples/phase-16/1602/MazeRunner3DScene.js
31+
- samples/phase-16/1604/Platformer3DBasicsScene.js
32+
- optional: sample-local helper or debug notes only if required for the visibility check
33+
- docs/dev/reports/* generated by validation
34+
35+
## Out of Scope
36+
- no engine-wide 3D renderer rewrite
37+
- no asset/content pipeline changes
38+
- no advanced lighting/material work
39+
- no gameplay expansion for 1602/1604
40+
- no repo-wide scanning
41+
42+
## Required Fix Direction
43+
Implement the smallest valid correction that makes geometry visible:
44+
1. verify camera-space forward convention
45+
2. verify pitch sign convention
46+
3. verify near-plane clipping assumptions
47+
4. verify viewport focal length / framing
48+
5. verify sample camera placement against actual object extents
49+
6. preserve shared-path consistency across 1601/1602/1604
50+
51+
## Acceptance Criteria
52+
- [ ] 1602 displays visible 3D maze geometry on load
53+
- [ ] 1604 displays visible 3D platform geometry on load
54+
- [ ] movement/input still works in both samples
55+
- [ ] 1601 still displays correctly after shared-path correction
56+
- [ ] no 2D regression introduced
57+
- [ ] no networking regression introduced
58+
- [ ] samples/index.html remains correct for Phase 16 entries
59+
60+
## Validation
61+
- launch smoke for affected Phase 16 samples
62+
- runtime confirmation that at least one expected projected edge/shape is visible on first render for 1601, 1602, and 1604
63+
- targeted regression check only; do not expand scope

samples/phase-16/1601/CubeExplorer3DScene.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function createBoxVertices(transform3D, size3D) {
4242

4343
function rotateToCameraSpace(point, cameraState) {
4444
const yaw = -(cameraState.rotation.y ?? 0);
45-
const pitch = -(cameraState.rotation.x ?? 0);
45+
const pitch = cameraState.rotation.x ?? 0;
4646

4747
let x = point.x - cameraState.position.x;
4848
let y = point.y - cameraState.position.y;

samples/phase-16/1602/MazeRunner3DScene.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ export default class MazeRunner3DScene extends Scene {
111111
const player = this.world.requireComponent(this.playerId, 'transform3D');
112112
this.camera3D.setPosition({
113113
x: player.x,
114-
y: 11.5,
115-
z: player.z - 9.6,
114+
y: 10.2,
115+
z: player.z - 10.6,
116116
});
117117
this.camera3D.setRotation({
118-
x: -0.62,
118+
x: -0.5,
119119
y: 0,
120120
z: 0,
121121
});
@@ -164,8 +164,8 @@ export default class MazeRunner3DScene extends Scene {
164164
renderer.strokeRect(this.viewport.x, this.viewport.y, this.viewport.width, this.viewport.height, '#d8d5ff', 2);
165165

166166
const cameraState = this.camera3D?.getState?.() ?? {
167-
position: { x: 0, y: 10, z: -8 },
168-
rotation: { x: -0.6, y: 0, z: 0 },
167+
position: { x: 0, y: 10.2, z: -7.4 },
168+
rotation: { x: -0.5, y: 0, z: 0 },
169169
};
170170
const projectionViewport = createProjectionViewport(this.viewport);
171171

samples/phase-16/1604/Platformer3DBasicsScene.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export default class Platformer3DBasicsScene extends Scene {
113113
});
114114
this.camera3D.setRotation({
115115
x: -0.42,
116-
y: 0.72,
116+
y: -0.72,
117117
z: 0,
118118
});
119119
}
@@ -205,7 +205,7 @@ export default class Platformer3DBasicsScene extends Scene {
205205

206206
const cameraState = this.camera3D?.getState?.() ?? {
207207
position: { x: -10, y: 5, z: 2 },
208-
rotation: { x: -0.4, y: 0.7, z: 0 },
208+
rotation: { x: -0.42, y: -0.72, z: 0 },
209209
};
210210
const projectionViewport = createProjectionViewport(this.viewport);
211211

samples/phase-16/shared/threeDWireframe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function createBoxVertices(transform3D, size3D) {
3131

3232
function rotateToCameraSpace(point, cameraState) {
3333
const yaw = -(cameraState.rotation.y ?? 0);
34-
const pitch = -(cameraState.rotation.x ?? 0);
34+
const pitch = cameraState.rotation.x ?? 0;
3535

3636
let x = point.x - cameraState.position.x;
3737
let y = point.y - cameraState.position.y;

0 commit comments

Comments
 (0)