Strengthen seed determinism smoke
This commit is contained in:
@@ -383,6 +383,7 @@ def _prompt_row(
|
|||||||
category: str,
|
category: str,
|
||||||
subcategory: str,
|
subcategory: str,
|
||||||
seed: int,
|
seed: int,
|
||||||
|
seed_config: str | dict[str, Any] | None = None,
|
||||||
character_cast: str = "",
|
character_cast: str = "",
|
||||||
women_count: int = 1,
|
women_count: int = 1,
|
||||||
men_count: int = 1,
|
men_count: int = 1,
|
||||||
@@ -410,6 +411,7 @@ def _prompt_row(
|
|||||||
prepend_trigger_to_prompt=True,
|
prepend_trigger_to_prompt=True,
|
||||||
extra_positive="",
|
extra_positive="",
|
||||||
extra_negative="",
|
extra_negative="",
|
||||||
|
seed_config=seed_config,
|
||||||
character_cast=character_cast,
|
character_cast=character_cast,
|
||||||
women_count=women_count,
|
women_count=women_count,
|
||||||
men_count=men_count,
|
men_count=men_count,
|
||||||
@@ -5244,6 +5246,55 @@ def smoke_seed_config_policy() -> None:
|
|||||||
_expect(rng_a.random() == rng_b.random(), "prompt_builder axis RNG should delegate to seed_config")
|
_expect(rng_a.random() == rng_b.random(), "prompt_builder axis RNG should delegate to seed_config")
|
||||||
_expect(pb._row_seed(123, 7, 41) == seed_config.row_seed(123, 7, 41), "row seed wrapper drifted from seed_config")
|
_expect(pb._row_seed(123, 7, 41) == seed_config.row_seed(123, 7, 41), "row seed wrapper drifted from seed_config")
|
||||||
|
|
||||||
|
deterministic_seed = 3901
|
||||||
|
deterministic_config = pb.build_seed_lock_config_json(base_seed=deterministic_seed)
|
||||||
|
deterministic_kwargs = {
|
||||||
|
"name": "seed_config_policy_deterministic",
|
||||||
|
"category": "Hardcore sexual poses",
|
||||||
|
"subcategory": "Penetrative sex",
|
||||||
|
"seed": deterministic_seed,
|
||||||
|
"seed_config": deterministic_config,
|
||||||
|
"character_cast": _character_cast(),
|
||||||
|
"hardcore_position_config": _action_filter("penetration_only"),
|
||||||
|
"location_config": _coworking_location_config(),
|
||||||
|
}
|
||||||
|
deterministic_a = _prompt_row(**deterministic_kwargs)
|
||||||
|
deterministic_b = _prompt_row(**deterministic_kwargs)
|
||||||
|
_expect(deterministic_a == deterministic_b, "locked seed config should reproduce identical prompt row output")
|
||||||
|
|
||||||
|
pose_changed = False
|
||||||
|
for reroll_seed in range(deterministic_seed + 1, deterministic_seed + 10):
|
||||||
|
pose_reroll = _prompt_row(
|
||||||
|
name="seed_config_policy_pose_reroll",
|
||||||
|
category="Hardcore sexual poses",
|
||||||
|
subcategory="Penetrative sex",
|
||||||
|
seed=deterministic_seed,
|
||||||
|
seed_config=pb.build_seed_lock_config_json(
|
||||||
|
base_seed=deterministic_seed,
|
||||||
|
reroll_axis="pose",
|
||||||
|
reroll_seed=reroll_seed,
|
||||||
|
),
|
||||||
|
character_cast=_character_cast(),
|
||||||
|
hardcore_position_config=_action_filter("penetration_only"),
|
||||||
|
location_config=_coworking_location_config(),
|
||||||
|
)
|
||||||
|
_expect(
|
||||||
|
pose_reroll.get("cast_descriptor_text") == deterministic_a.get("cast_descriptor_text"),
|
||||||
|
"pose reroll should keep locked cast descriptors stable",
|
||||||
|
)
|
||||||
|
_expect(
|
||||||
|
pose_reroll.get("scene_text") == deterministic_a.get("scene_text"),
|
||||||
|
"pose reroll should keep locked scene stable",
|
||||||
|
)
|
||||||
|
if (
|
||||||
|
pose_reroll.get("position_key") != deterministic_a.get("position_key")
|
||||||
|
or pose_reroll.get("source_role_graph") != deterministic_a.get("source_role_graph")
|
||||||
|
or pose_reroll.get("item") != deterministic_a.get("item")
|
||||||
|
):
|
||||||
|
pose_changed = True
|
||||||
|
break
|
||||||
|
_expect(pose_changed, "pose reroll should change pose/action metadata while cast and scene stay locked")
|
||||||
|
|
||||||
|
|
||||||
def smoke_node_camera_registration() -> None:
|
def smoke_node_camera_registration() -> None:
|
||||||
required_nodes = [
|
required_nodes = [
|
||||||
|
|||||||
Reference in New Issue
Block a user