bevyengine / bevyengine/bevy

Float literal is Nan

Open
#16,962 0 comments 0 reactions 0 assignees View on GitHub
A-Math C-Bug S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

0.15

## Relevant system information

Endeavour OS linux (arch based)
Intel(R) Core(TM) i5-8350U (8) @ 3.60 GHz
Cosmic DE

```
AdapterInfo { name: "Intel(R) UHD Graphics 620 (KBL GT2)", vendor: 32902, device: 22807, device_type: IntegratedGpu, driver: "Intel open-source Mesa driver", driver_info: "Mesa 24.3.2-arch1.1", backend: Vulkan }
```

## What you did

I'm creating a random art generator [here](https://github.com/patrulhasirius/bevy_randomart) that dinamically generates shader code based on an ast and runs it.

## What went wrong

When building huge function chains bevy sometimes says:

`Float literal is NaN`

And highlights a section of code, however, copying the hightlited code and pasting it into some tool like [this](https://github.com/paulgb/wgsl-playground) does not give any errors.

The error is very inconsistent, but I found that running my code, pressing "s" to input a seed and inputing the number 47 recreates the bug.

## Additional information

It's very much possible that my code generates bad wgsl code, but the error is not clear on what is the actual problem.

Contributor guide

Open the contributing guide

Research direction

Reproduce the report using the linked bevy_randomart project, entering seed 47 after pressing "s". Inspect the generated WGSL around Bevy's highlighted location and compare it with the same code in the WGSL playground; done means identifying whether the generated shader or Bevy's diagnostic is responsible for the NaN error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.