| name | passctx-field-propagation |
| description | When adding new mandatory fields to PassCtx, use replace_all on the closing }); pattern to add fields at all 22+ construction sites — then handle the 1-2 sites that don't match the common pattern separately |
| source | auto-skill |
| extracted_at | 2026-06-15T04:29:18.101Z |
PassCtx field propagation
stratum_hook::PassCtx is constructed at 22+ sites in
crates/titan-rendering-3d/src/lib.rs. Adding a new mandatory field
requires updating every site. The efficient approach:
Step 1: Add the field to PassCtx struct
In crates/titan-rendering-3d/src/stratum_hook.rs:
pub struct PassCtx<'a> {
pub new_field: bool,
}
Step 2: Bulk-update common sites with replace_all
Most PassCtx construction sites end with tap_registry: &mut self.tap_registry,
then });. Use replace_all to add the new field after tap_registry:
Find: tap_registry: &mut self.tap_registry,
});
Replace: tap_registry: &mut self.tap_registry,
new_field: self.new_field,
});
Replace all 16+ occurrences in one edit.
Step 3: Handle sites without tap_registry
Some sites end with taa_jitter_delta_px, instead (the specular temporal and
diffuse temporal dispatch arms don't have #[cfg(feature = "debug-dumps")]
blocks). These need a second replace_all:
Find: taa_jitter_delta_px,
#[cfg(feature = "debug-dumps")]
tap_registry: &mut self.tap_registry,
});
Replace: taa_jitter_delta_px,
#[cfg(feature = "debug-dumps")]
tap_registry: &mut self.tap_registry,
new_field: self.new_field,
});
Step 4: Handle the remaining oddball
The record_svgf_atrous site uses taa_jitter_delta_px: None, (colon, literal)
instead of taa_jitter_delta_px, (comma, variable). Find it with a unique
context anchor and fix manually.
Step 5: Add accessor to Renderer3d
If the new field comes from Renderer3d state, add a public accessor:
#[must_use]
pub fn new_field(&self) -> bool { self.new_field }
Verification
cargo check -p titan-rendering-3d