You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(render): inspect shadow jobs without starting work - #2461
The scale-limited export test called cast_shadows(false, …) to check that no shadow work had started. That call itself starts work, and a fast worker can finish before the result is inspected, causing a spurious failure.
Inspect the layer's retained light jobs without starting work instead. Both layer and group scale limits must leave the list empty; the existing tilted-export test also checks that completed jobs remain observable.
This changes test observation only. Desktop, browser, CLI, Python, touch, ribbon, shortcuts, command search, Assistant, MCP, plugins, and Undo/Redo retain their existing behavior. No file format, command parameter, dependency, or third-party code is introduced.
Testing
cargo xtask ci passed: test hygiene, formatting, workspace clippy with warnings denied, workspace tests, layers, and schema (29 fixtures).
No actionable comments were generated in the recent review.
Walkthrough
RasterLayer adds a hidden public method that counts retained cast-shadow and sky-light jobs, including completed jobs. Render tests use the count to check retained work after export and confirm that excluded layers start no cast-shadow jobs.
Changes: Cast-shadow job inspection
Layer / File(s)
Summary
Expose and verify retained light-job count crates/map/src/raster.rs, crates/render/src/lib.rs
RasterLayer::cast_shadow_jobs() reports retained light jobs without starting work. Render tests assert that completed jobs remain observable and that layers excluded by scale range or group visibility start zero cast-shadow jobs.
opengeos/RustGIS#1823: Changes export shadow-waiting logic and adds the test that this PR updates.
Suggested reviewers:elpidioassinaturas, giswqs
Merge Risk: Minimal · up to c07e5
This is a test-observation change with no user-visible behavior change. It is expected to remove a flaky render test, and no merge-blocking risk is evident.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the render tests now inspect shadow jobs without starting work. It matches the raw summary, which adds a non-starting job count method and updates two render tests to …
Description check
The description follows the template. It has a Summary that explains the flaky test cause and the fix. It has a Testing section with specific commands and results. The UI evidence section states 'No v…
Linked Issues check
Directly linked issue [#2453] asks to remove the timing-dependent check that a scale-limited relief layer does not start shadow work. The reviewed head changes that check. Per the change summary, `Ras…
Out of Scope Changes check
The changes are limited to the test observation path: one hidden public inspection method cast_shadow_jobs on RasterLayer (+7 lines in crates/map/src/raster.rs) and two render test assertions (+2/…
Full details: Title check
Explanation
The title names the main change: the render tests now inspect shadow jobs without starting work. It matches the raw summary, which adds a non-starting job count method and updates two render tests to assert on it. The title uses the conventional test(render) prefix and stays concise.
Full details: Description check
Explanation
The description follows the template. It has a Summary that explains the flaky test cause and the fix. It has a Testing section with specific commands and results. The UI evidence section states 'No visible UI change.', which the template allows. The Related issue section links #2453 with a closing keyword. The description is complete and specific.
Full details: Linked Issues check
Explanation
Directly linked issue [#2453] asks to remove the timing-dependent check that a scale-limited relief layer does not start shadow work. The reviewed head changes that check. Per the change summary, RasterLayer::cast_shadow_jobs (crates/map/src/raster.rs) returns the retained cast-shadow and sky-light job count without starting work. The scale-limited test in crates/render/src/lib.rs now asserts zero shadow jobs after rendering, instead of calling cast_shadows(false, …), which can start work. The tilted-export test now asserts at least one job remains observable and still checks that shadows are ready. This addresses the issue's stated observation problem. The repository diff could not be read (changed blobs missing from checkout), so this verdict rests on the supplied PR summary and description. The PR summary reports the test passing 100/100 runs under concurrent load, which is consistent with the fix but is not independently verified here.
Full details: Out of Scope Changes check
Explanation
The changes are limited to the test observation path: one hidden public inspection method cast_shadow_jobs on RasterLayer (+7 lines in crates/map/src/raster.rs) and two render test assertions (+2/-4 in crates/render/src/lib.rs). The method exists only to support the revised tests. The PR description states no change to file formats, command parameters, dependencies, or user-visible behavior. No unrelated change is described in the summary. The repository diff could not be read, so this verdict relies on the change summary and PR description.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit counts the shadows that remain, And finds the finished jobs still in the frame. The tilted map keeps proof of work in sight, Excluded layers start no jobs that night. One hop, one count, the tests now know.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: eda8dbcb-13ef-4ad9-8380-ada9473aedfb
Commits
Reviewing files that changed from the base of the PR and between eac275f and c07e5b0.
Files selected for processing: 2
crates/map/src/raster.rs
crates/render/src/lib.rs
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
I found no bugs, security issues, or performance problems in this PR. No inline comments were warranted, so I posted none.
Bugs
None found. cast_shadow_jobs locks the same Arc<Mutex<Vec<LightJob>>> that cast_shadow_waiters uses and only reads its length. Copies of a layer share that Arc, which matches the doc comment. The export test now asserts zero jobs, which is stronger than the old Pending check: it fails if drawing starts any light work. (Confidence: high.)
Security
None found. The change is test observation with no new input handling.
Performance
None found. The new method is O(1) and only runs in tests.
Quality
Low-severity inconsistency: cast_shadow_jobs recovers from a poisoned lock with unwrap_or_else(|e| e.into_inner()), while the sibling cast_shadow_waiters returns 0 on poison. Either behaviour is harmless here. Per the release quality pass, I'd leave it unless a maintainer wants them aligned. (Confidence: high that it exists; low that it matters.)
Low-severity: the first test (crates/render/src/lib.rs, around line 9593) still ends with cast_shadows(false, …), the same work-starting call the PR description names as the root cause. It is safe in practice: the export only returns after the far band's grid has landed, so the call finds a finished job and does not start new work. Replacing it with an inspection would make the test match its stated intent. (Confidence: medium.)
AGENTS.md
Compliant. No unwrap, expect, or unsafe is added to non-test code, and the unwrap_or_else is allowed by the crate's deny block. The new helper is #[doc(hidden)], matching cast_shadow_waiters, and its doc comment says it is for tests. No new command, tool, or export is added, so the long_commands lists and the wasm build are unaffected. The PR body states that no visible UI changed.
Earlier review threads: none exist on this PR, so no earlier concerns were left alone.
Change size
Compared with main (merge base 89385f6 to PR head c07e5b0); whole PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The scale-limited export test called
cast_shadows(false, …)to check that no shadow work had started. That call itself starts work, and a fast worker can finish before the result is inspected, causing a spurious failure.Inspect the layer's retained light jobs without starting work instead. Both layer and group scale limits must leave the list empty; the existing tilted-export test also checks that completed jobs remain observable.
This changes test observation only. Desktop, browser, CLI, Python, touch, ribbon, shortcuts, command search, Assistant, MCP, plugins, and Undo/Redo retain their existing behavior. No file format, command parameter, dependency, or third-party code is introduced.
Testing
cargo xtask cipassed: test hygiene, formatting, workspace clippy with warnings denied, workspace tests, layers, and schema (29 fixtures).RUSTFLAGS='-D warnings' cargo build --locked --target wasm32-unknown-unknown -p rustgis-webpassed.UI evidence
No visible UI change.
Related issue
Closes #2453
Summary by CodeRabbit