Ridge baker tests: check wall distance and albedo in every wall column
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m36s
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m36s
The face-up albedo mutant still survives (no fixture has a wall under a face steep enough to move the albedo: not yet reached); the card-0 wall mutant is killed by the near-hill fixture. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3b5c2a2487
commit
2e3e9133c0
1 changed files with 1 additions and 1 deletions
|
|
@ -307,7 +307,7 @@ def test_wall_rows_flagged():
|
|||
k0, a0 = _first_sample_angle(b, i); want = (lo[:, None] < a0[None, :])[c['top']:c['top'] + c['alpha'].shape[0]]; assert (c['wall'] == want).all(), ('wall rows are not the rows below the first sample', i, int((c['wall'] != want).sum())); seen += int(want.sum())
|
||||
geo = export.decode(export.encode_geometry(c['n_r'], c['n_t'], c['logd'], b['meta']['encoding'], c['wall'])); r, t = geo[..., 0] / 255.0 * 2 - 1, geo[..., 1] / 255.0 * 2 - 1; code = (geo[..., 0] == 255) & (geo[..., 1] == 255)
|
||||
assert (code == c['wall']).all() and (r[~code] ** 2 + t[~code] ** 2 <= 1.02).all(), 'the wall code is not on exactly the wall pixels, or a real normal reaches it'
|
||||
for x in np.flatnonzero(c['wall'].any(0))[::40]:
|
||||
for x in np.flatnonzero(c['wall'].any(0)):
|
||||
rows = np.flatnonzero(c['wall'][:, x]); ld = c['logd'][rows, x]; assert np.ptp(ld) < 1e-5 and abs(math.exp(ld[0]) - D[k0[x]]) < 1e-3 * D[k0[x]] + 60, ('a wall keeps its sample distance', x)
|
||||
want_alb = ridge.albedo(np.array([b['h'][k0[x], x]]), np.array([1.0]))[0]; assert np.abs(c['albedo'][rows, x] - want_alb).max() < 1e-5, ('wall albedo is not the ground material with the face up', x)
|
||||
assert seen > 1000, 'the fixture has no wall'
|
||||
|
|
|
|||
Loading…
Reference in a new issue