@@ -2204,6 +2204,137 @@ TEST(VulkanComputeGraphTest, was_value_updated_checks_nested_value_lists) {
22042204 EXPECT_TRUE (graph.was_value_updated (outer_list));
22052205}
22062206
2207+ TEST (VulkanComputeGraphTest, execute_node_resize_tracks_read_arg_updates) {
2208+ GraphConfig config;
2209+ ComputeGraph graph (config);
2210+
2211+ const ValueRef output = graph.add_symint (1 );
2212+ const ValueRef input = graph.add_symint (2 );
2213+ size_t resize_count = 0 ;
2214+ ExecuteNode node (
2215+ [&resize_count](ComputeGraph*, const auto &, const auto &) {
2216+ ++resize_count;
2217+ },
2218+ {},
2219+ {{output, vkapi::kWrite }, {input, vkapi::kRead }});
2220+
2221+ graph.set_symint (input, 3 );
2222+
2223+ EXPECT_TRUE (node.trigger_resize (&graph));
2224+ EXPECT_EQ (resize_count, 1 );
2225+ }
2226+
2227+ TEST (VulkanComputeGraphTest, execute_node_resize_tracks_write_arg_updates) {
2228+ GraphConfig config;
2229+ ComputeGraph graph (config);
2230+
2231+ const ValueRef output = graph.add_symint (1 );
2232+ const ValueRef input = graph.add_symint (2 );
2233+ size_t resize_count = 0 ;
2234+ ExecuteNode node (
2235+ [&resize_count](ComputeGraph*, const auto &, const auto &) {
2236+ ++resize_count;
2237+ },
2238+ {},
2239+ {{output, vkapi::kWrite }, {input, vkapi::kRead }});
2240+
2241+ graph.set_symint (output, 3 );
2242+
2243+ EXPECT_TRUE (node.trigger_resize (&graph));
2244+ EXPECT_EQ (resize_count, 1 );
2245+ }
2246+
2247+ TEST (VulkanComputeGraphTest, execute_node_resize_tracks_read_write_updates) {
2248+ GraphConfig config;
2249+ ComputeGraph graph (config);
2250+
2251+ const ValueRef value = graph.add_symint (1 );
2252+ size_t resize_count = 0 ;
2253+ ExecuteNode node (
2254+ [&resize_count](ComputeGraph*, const auto &, const auto &) {
2255+ ++resize_count;
2256+ },
2257+ {},
2258+ {{value, vkapi::kReadWrite }});
2259+
2260+ graph.set_symint (value, 2 );
2261+
2262+ EXPECT_TRUE (node.trigger_resize (&graph));
2263+ EXPECT_EQ (resize_count, 1 );
2264+ }
2265+
2266+ TEST (VulkanComputeGraphTest, execute_node_resize_tracks_nested_resize_args) {
2267+ GraphConfig config;
2268+ ComputeGraph graph (config);
2269+
2270+ const ValueRef value = graph.add_symint (1 );
2271+ const ValueRef inner_list = graph.add_value_list ({value});
2272+ const ValueRef outer_list = graph.add_value_list ({inner_list});
2273+ size_t resize_count = 0 ;
2274+ ExecuteNode node (
2275+ [&resize_count](ComputeGraph*, const auto &, const auto &) {
2276+ ++resize_count;
2277+ },
2278+ {outer_list});
2279+
2280+ graph.set_symint (value, 2 );
2281+
2282+ EXPECT_TRUE (node.trigger_resize (&graph));
2283+ EXPECT_EQ (resize_count, 1 );
2284+ }
2285+
2286+ TEST (VulkanComputeGraphTest, execute_node_resize_skips_unchanged_args) {
2287+ GraphConfig config;
2288+ ComputeGraph graph (config);
2289+
2290+ const ValueRef output = graph.add_symint (1 );
2291+ const ValueRef input = graph.add_symint (2 );
2292+ size_t resize_count = 0 ;
2293+ ExecuteNode node (
2294+ [&resize_count](ComputeGraph*, const auto &, const auto &) {
2295+ ++resize_count;
2296+ },
2297+ {},
2298+ {{output, vkapi::kWrite }, {input, vkapi::kRead }});
2299+
2300+ EXPECT_FALSE (node.trigger_resize (&graph));
2301+ EXPECT_EQ (resize_count, 0 );
2302+ }
2303+
2304+ TEST (VulkanComputeGraphTest, execute_node_force_resize_ignores_arg_updates) {
2305+ GraphConfig config;
2306+ config.force_resize = true ;
2307+ ComputeGraph graph (config);
2308+
2309+ size_t resize_count = 0 ;
2310+ ExecuteNode node ([&resize_count](ComputeGraph*, const auto &, const auto &) {
2311+ ++resize_count;
2312+ });
2313+
2314+ EXPECT_TRUE (node.trigger_resize (&graph));
2315+ EXPECT_EQ (resize_count, 1 );
2316+ }
2317+
2318+ TEST (
2319+ VulkanComputeGraphTest,
2320+ execute_node_data_dependent_resize_is_unconditional) {
2321+ GraphConfig config;
2322+ ComputeGraph graph (config);
2323+
2324+ size_t resize_count = 0 ;
2325+ ExecuteNode node (
2326+ [&resize_count](ComputeGraph*, const auto &, const auto &) {
2327+ ++resize_count;
2328+ },
2329+ {},
2330+ {},
2331+ " data_dependent_node" ,
2332+ true );
2333+
2334+ EXPECT_TRUE (node.trigger_resize (&graph));
2335+ EXPECT_EQ (resize_count, 1 );
2336+ }
2337+
22072338TEST (VulkanComputeGraphTest, resize_input_marks_staging_value_updated) {
22082339 GraphConfig config;
22092340 ComputeGraph graph (config);
0 commit comments