
**Task:** As a shader expert specializing in particle systems, you have the critical task of analyzing particle shader code within a structured framework.
This involves both scrutinizing the logic of how particles are created and behave, and ensuring the syntax adheres to proper rules.

**Instructions:**

**Part 1: Logic Analysis (Spawn and Simulation Nodes)**

1. **Prompt Deconstruction:**  Begin by dissecting the user's prompt to understand the intended visual effect and behavior of the particles.

2. **Node Examination:**  Carefully review the code within the "Spawn" node and the "Simulation" node.  

    * **Spawn Node:**  
        * Does the lifetime assignment make sense for the desired effect (e.g., short-lived sparks vs. long-lasting smoke)?
        * Is the particle position initialization aligned with the prompt (e.g., spawning from a point, a sphere, or a custom shape)?
        * Are the initial direction, speed, size, rotation, color, and emissive properties appropriate?

    * **Simulation Node:**
        * If the `Position` input is used, does it logically control the particle's movement over time?
        * Is the `Velocity` calculation producing the right kind of motion (e.g., straight, curved, random)?
        * Does the size evolve as expected (growing, shrinking, fluctuating)?
        * Are color and emissive changes happening in a way that matches the desired visual style?
        * Are `Linear Drag` and `Gravity` applied in a manner consistent with the prompt (if applicable)?
        * If `Collision` or `Flip Book` are used, do they integrate correctly and contribute to the intended effect?

3. **Flow Validation:**  Trace the particle's journey from spawn to simulation. Does the overall behavior (position, appearance, lifetime) match what the user described?

4. **Discrepancy Detection:**  Pinpoint any parts of the code where the particle's actions deviate from the prompt. Clearly articulate any errors or inconsistencies you discover.

5. **Refinement Proposals:** Offer concrete suggestions for modifying the code to better align it with the user's vision. If the logic is already sound, state this explicitly.

**Part 2: Syntax Checking**

  **Function/Node Adherence:**  Verify that each line of code is a valid function call or variable declaration. Ensure that every function's arguments are filled correctly (using '-' for unused ones).

  **Corrections and Modifications:** If you need to adjust the code, remember to adhere to the available functions/nodes list.

you should follow th code structure and convention which is
    **Node Utilization Over Direct Calculations**:
    Variable assignment direct from values is forbidden in this input-output node system.
    Instead, the variable assignment should happen ONLY through the output ports of the function.
    Moreover, avoid syntax with compound assignments. Every node has at least one output port, and you must utilize it for variable assignment.
    
    ** you cannot use a variable in two different functons output **

   EXAMPLES:

   - Incorrect usage: v3 = v1 + v2  // Direct assignment and any calculation outside given available fnctions are forbidden
   - Correct usage: Add(v1, v2, v3)

   - Incorrect usage: v3 = v1 * v2 // Direct assignment and any calculation outside given available functions are forbidden
   - Correct usage: Multiply(v1, v2, v3)

   - Incorrect usage: float x = cos(angle);  // Direct assignment and any calculation outside given available fnctions are forbidden
   - Correct usage: 
      float x;
      cos(angle,x);


Some Syntax error examples:
- Inline operations: TilingAndOffset(uv, vec2(4, 4), vec2(0, t * 0.1), tiledUV);  
    Problem: Direct multiply operation is not allowed. If one wants to multiply t by 0.1, they should do it beforehand like:
    float slow_t;
    Multiply(t, 0.1, slow_t);
- Incorrect usage of arguments. For example, the Remap function is used as Remap(In, InMinMax, OutMinMax, Out), *function and their arguemnt are availabel in Available Functions list.
    Using it like this is incorrect: Remap(noise, -1, 1, 0.5, 1, remappedNoise);
    It should be:
    Remap(noise, vec2(-1, 1), vec2(0.5, 1), remappedNoise);
- Using a function/node inside another function is WRONGE and FORBIDDEN:
    For example:
    ...
    Multiply(0.1, Sin(t), v2);
    ...
    It should be:
    ...
    float t2;
    Sin(t, t2);
    Multiply(0.1, t2, v2);
    ...


**Additional Notes:**

* **Two-Shader Structure:** Keep in mind that particle shaders have distinct spawn and simulation phases.
* **Syntax and Logic:** A shader can be syntactically perfect but still produce incorrect results due to flawed logic.
* **Available Functions:** {nodes} 
{particle_nodes}

a simple example of a particle shader:
**Example Prompt:**

"Explosive particles that shrink over time and are affected by gravity."

**Generated Compute Shader Code:**
// **Overall thinking process:
    //Explosive particles usually spawn from a spherical shape with random starting speeds and lifetimes. To control shrinking, we can manipulate the particle size using the particle age in the simulation also we can set gravity at the simulation end node.
// <Spawn Code>

    // Assign a random lifetime between 1 and 4
    float lifetime;
    RandomInRange(1, 4, 66, lifetime); // RandomInRange(min, max, seed, out)

    // Spawn particles in a sphere with a radius of 0.1
    vec3 position, direction;
    RandomPositionInSphere(0.1, position, direction); // Outputs in 'position' and 'direction'

    // Assign a random initial speed between 0 and 26
    float speed;
    RandomInRange(0, 26, 22, speed);

    // Set initial size to 0 (controlled in simulation) and use default rotation, color, and emissive values
    OutputVFXSpawnBlock(lifetime, position, direction, speed, 0, vec3(0, 0, 0), vec4(1, 1, 1, 1), vec3(0, 0, 0));

// <Simulation Code>

    // Compute the age normalized by lifetime (range 0 to 1)
    float normalizedAge;
    AgeOverLifetime(normalizedAge);

    // Retrieve the current velocity
    vec3 velocity;
    GetCurrentVelocity(velocity);

    // Scale size inversely with age (to shrink over time)
    float shrinkFactor;
    SubtractBlock(1, normalizedAge, shrinkFactor);

    // Assign a random scale factor between 1 and 2 to each particle
    float randomScale;
    RandomInRange(1, 2, 34, randomScale);

    // Calculate final size after applying shrink factor
    float finalSize;
    MultiplyBlock(shrinkFactor, randomScale, finalSize);

    // Output updated particle properties, enable gravity (1) and set other properties to default
    OutputVFXSimulationBlock(-,velocity, finalSize, vec4(1, 1, 1, 1), vec3(0, 0, 0), vec3(0, 0, 0), 3, 1, vec4(0, 0, 0, 0), 0);

you changes anything put the new code after ### Corrected Code