#archived-dots

1 messages Β· Page 27 of 1

rotund token
#

In a build you get a full stack

#

Memory dump

errant hawk
#

Quick question: you can make a source generator inside unity, right? I don't need to make it outside of unity anymore?

rotund token
#

With the exception to that being ecb playback crashes

rotund token
viral sonnet
#

this is where the singleton is setup

rotund token
#

That seems pretty straight forward

errant hawk
#

@viral sonnet sometimes what I do is delete all the compiled files to force a recompile if I'm having issues

late mural
#

hmm, im wondering does some sort of native list exist? as i need to pass in and out of a job an array of unknown length of ints (usually lists would be used for this in situations without jobs)

rotund token
#

Yes it's called native list

late mural
#

oh

#

welp thanks a ton, sorry for my stupidity!

viral sonnet
#

order seems also correct. broadphase runs way after the picker system

#

yeah, no idea. as i said, i don't even think it's a physics issue. there are a bunch of errors beforehand that maybe break the loading sequence

#

and those are all related to errors for internal unity comps that have no constructor - but they do πŸ˜„

errant hawk
viral sonnet
#

you never answered if you have a working build

errant hawk
#

90% of it has been URP shit

#

idk why it's taking so long, last build I did that wasn't ECS took 20s and was far more complex (and used URP)

viral sonnet
#

it always takes so long on a fresh projects/new unity version. urp/hdrp takes ages to compile. but only once

errant hawk
#

even then, I do a clean build every now-and-then and it takes less-than a minute

rotund token
#

cant be on il2cpp

errant hawk
#

im not

#

I never am

rotund token
#

no console plans then i take it

errant hawk
#

pure windows atm

#

This is just a test project for various ECS-based mechanics

#

10 mins in

viral sonnet
rotund token
#

if it's mono something gone wrong

rotund token
#

at least

#

i could incremental build in like a minute or two in 21

viral sonnet
#

you know i've only made a mono build. i'll try an il2cpp now

errant hawk
misty wedge
errant hawk
#

The bar went down...

rotund token
#

what did your dmp say - i was curious if it was the same issue i had

errant hawk
rotund token
#

when you crash a .dmp file is generated

#

it's how you should debug crashes

misty wedge
#

Yeah I know, but I was looking at the mono dump earlier

#

I wasn't sure which one you meant

rotund token
#

oh yeah the il2cpp

#

dmp

misty wedge
#

Ah forgot which build was il2cpp 😬

#

Does it say anywhere in the logs?

#

iirc it does

rotund token
#

probably

misty wedge
#

Ill check

viral sonnet
#

hm, .net standard 2.1 is okay, right?

rotund token
#

what you should be using

misty wedge
viral sonnet
#

same line in the il2cpp build

misty wedge
viral sonnet
#

yes but not any further πŸ˜„

misty wedge
errant hawk
#

getting close...

rotund token
#

but you'd need to match your exe/dll/pdbs to the actual build

misty wedge
#

Yeah I'm making another build

#

Let's see if unity lets me...

errant hawk
viral sonnet
#

can you post your player.log?

errant hawk
viral sonnet
#

AppData\LocalLow\companyName\gameName

misty wedge
#

Asset has disappeared while building player to 'globalgamemanagers.assets' - path '', instancedID '-2564288' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) please kill me

late mural
#

hey does .Add() work with native lists? (im pretty sure it doesnt, but making certain)

misty wedge
#

It works normally, like a normal C# list

late mural
#

hmm, odd

misty wedge
#

You need to be careful when copying the struct around though, since the Length property may only change on the copy

rotund token
#

heh that's only for unsafe list

misty wedge
#

Oh, right. My bad

late mural
#

oh, im trying to do a foreach loop on the nativelist outside of the job

errant hawk
misty wedge
#

But now I can replace them all!

late mural
#

i cant remember the last time i didnt use an unsafe void lol

errant hawk
late mural
#

but anyway, back to the native lists, i cant seem to get them to change, they seem determined to stay the same

late mural
viral sonnet
errant hawk
#

runs perfectly fine, other than what I mentioned above

misty wedge
#

I think they're tricking us @viral sonnet

viral sonnet
#

πŸ˜„

misty wedge
#

This also likes to happen now:

#

It's just stuck on begin sometimes

#

I need to kill unity and try again

viral sonnet
#

on build or code recompile?

errant hawk
#

yeah that's just unity

misty wedge
#

build

viral sonnet
#

it'll begin ... any minute now ... πŸ’€

misty wedge
#

Lies

#

I let it run for 10 minutes earlier

errant hawk
#

wait till it's on recompile and you got changes to save πŸ’©

viral sonnet
#

i killed unity 3 times on recompiles. was just stuck

coarse turtle
#

oh - are there any docs about builds with entities now? I think I remember reading somewhere in this chat, build configuration assets weren't needed (I might be wrong)

errant hawk
#

preferences > entities > Builtin Builds Enabled

viral sonnet
#

any idea what this is on build? 'GlobalCooldown' is missing the class attribute 'ExtensionOfNativeClass'! it's just public struct GlobalCooldown : IComponentData { public uint gcdStarted; public uint gcdEnding; }

rotund token
#

oh we see this in 2020.3 with entities 0.50

viral sonnet
#

nothing to worry about, right?

rotund token
#

weve never had an issue just annoying warnings

viral sonnet
#

odd, i have so many comps and for 2 the build complains

rotund token
#

if you want to hide warning you can literally make an attribute of that name and attachit

#

yeah we have 2 i think as well

#

and they juts seem random

viral sonnet
#

warning? i have them as error

rotund token
#

(though i think we have 750 comps)

#

oh error during building right?

viral sonnet
#

is the poor soul looking forward to writing bakers?

rotund token
#

we dont have any conversion ^_^'

#

this project is old

viral sonnet
#

yeah, error is thrown but build isn't cancelled.

#

probably it has nothing to do with the build. it's thrown from here UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

#

eh, whatever πŸ˜„ never had this before though

misty wedge
#

absolutely dunked on you

errant hawk
misty wedge
#

Yeah, and my computer was basically unusable while it was going

errant hawk
#

I had other shit running too so yeahhh....

devout prairie
#

did you get a build with physics working?

misty wedge
#

Nope

#

But I managed to get past the splash screen

devout prairie
#

ahh

errant hawk
devout prairie
devout prairie
misty wedge
#

I'm guessing the crash is the same on I had on mono, same one as @viral sonnet

devout prairie
#

i wonder what's causing problems then

#

ahh it's just on mono

misty wedge
devout prairie
#

ah sorry getting my terminology mixed up i think

#

i thought you meant it was not an il2cpp build

misty wedge
#

Physics crashes on both il2cpp and mono for me and @viral sonnet

devout prairie
#

ahhhhhhh

#

ok so it's not just mono then πŸ˜›

misty wedge
#

Doesn't seem that way

devout prairie
#

i wonder why it's ok for Extevious and not for you guys

misty wedge
#

Yeah that is odd

#

I have the exact same errors as enzi, and the same exact crash position in the stacktrace

devout prairie
#

i guess it could be tricky to track down from our side

#

could be something like a bug with unique colliders, or using two worlds, or any possible variety of thing

rotund token
#

never fear tertle is here πŸ˜„
crashes is what i spend half my life debugging -_-

devout prairie
#

i've always thought that about myself

errant hawk
devout prairie
#

i seem to very quickly hit the limits of what things weren't designed to do.. it's a talent

void girder
#

Does the MaterialProperty attribute still work for components?

rotund token
#

they changed something about it

void girder
#

For some reason MaterialPropertyFormat doesn't seem to exist anymore

rotund token
#

but i haven't looked at rendering yet

#

yeah i think that was what it was, not needed anymore

#

it's determined by the struct

void girder
#

/// <summary> /// Constructs a material property attribute. /// </summary> /// <param name="materialPropertyName">The name of the material property.</param> /// <param name="overrideSizeGPU">An optional size of the property on the GPU.</param> public MaterialPropertyAttribute(string materialPropertyName, short overrideSizeGPU = -1) { Name = materialPropertyName; OverrideSizeGPU = overrideSizeGPU; }

errant hawk
#

Ok so to elaborate on what my project is like: It's a basic plane with mesh collider, some non-uniform cubes in the scene, and a convex hull for a vehicle that I drive around in

#

@viral sonnet how complex is your scene that causes it to crash/errors?

#

have you tried stripping out anything that is related to the errors?

rotund token
# void girder ` /// <summary> /// Constructs a material property attribute. ...

Yes, the MaterialProperty attribute no longer has a format enum, Entities Graphics just uses the size of the type. That enum only had meaning for HRv1, and has in practice has been unused for a long time.

No, nowadays you only have to type

[MaterialProperty("NAME")]

. The second integer is used for actually overriding the size to be something else, but I don't think that parameter is really useful, that feature is only used internally for optimizing transform matrix size on the GPU.

https://forum.unity.com/threads/hybrid-rendering-package-becomes-entities-graphics.1323792/

devout prairie
#

Well i need some sleep.. i'll leave you guys to solve all of the transition to 1.0 problems and come back in three weeks to search all the answers πŸ˜›

misty wedge
devout prairie
#

I will say thanks, it's the least i could do

#

The dots channel is like the raptor cage in jurassic park, we're all sneaking around testing for weak points to break out

errant hawk
devout prairie
misty wedge
# rotund token oh yeah the il2cpp

After rebuilding with il2cpp I can get to the splash screen now for some reason, I have no idea why. It now crashes on the OnCreate in the broadphase system

#

Sadly I couldn't recover the other build that crashed immediately 😦

viral sonnet
#

the physics sample also runs fine.

rotund token
#

blah i'm still blocked by aliasing bug i reported

#

the workaround we thought of didn't seem to work

errant hawk
#

I swear you guys are coming across some weird-ass bugs

viral sonnet
#

not even one error or warning in the player.log

errant hawk
rotund token
errant hawk
#

maybe it's a conflict with your system somehow

rotund token
#

The issue is that IL2CPP is getting mixed up when dealing with unions of fields and incorrectly applies 1 byte padding to the outer type. This makes BlobAssetReferences appear to be 8 bytes in size but an alignment requirement of 1. This is a problem since mono sees your component

    {
        public BlobAssetReference<MetaData> Value;
        internal bool IsSetup;
    }```
> as 16 bytes and il2cpp sees it as 9 leading to deserialization issues/corruption
#

this component breaks il2cpp

errant hawk
#

oof yeah that's a big issue

rotund token
#

so yeah if you're using BlobAssetReference be careful

errant hawk
#

also @rotund token you were questioning how the new aspect types would do compared to IJobEntityBatch

rotund token
#

i was?

errant hawk
#

yeah, a while back

rotund token
#

(if anything i think i was probably questioning how they would work with IJobEntityBatch?)

errant hawk
#

one sec let me find the message...

#

This message

rotund token
#

yeah how they will work with ijobentitybatch

errant hawk
#

wait

#

are aspects even available?

#

huh, looks like they are

rotund token
#

i was mostly concerned at that time that aspects would be tied to code gen and require one of the code gen jobs to function

errant hawk
#

Just curious what your take was on it now that we have access to them

rotund token
#

havent looked at them at all yet

#

still updating libraries

#

nearly there

errant hawk
#

ah alright

rotund token
#

once that is done it's time to modernize my api and look at features

errant hawk
#

my ECS libs are really simple, nothing crazy atm

#

I want to netcode a game, but I'm still waiting for more support

rotund token
#

i find netcode works well

#

just poorly documented

#

ok well i can't build il2cpp for the aliasing issues

#

but i add physics and built a mono no problem

errant hawk
#

(as it turns out it's only @viral sonnet and @devout prairie having these issues)

rotund token
#

still on b8

errant hawk
#

same

rotund token
#

yeah very simply physics test worked as well

#

cube falling onto plane

#

so yeah not sure, physics builds fine for me

errant hawk
rotund token
#

nope

#

but there are half a dozen people complaining about this on forums

errant hawk
#

can you add more cubes like 100 or so

#

it has something to do with lag

wraith hinge
#

Build testing infrastructure has indeed been not up to snuff relative to other things, and it clearly shows. Fortunately we are pushing hard on that right now in master and it’s improving (and finding bugs)

errant hawk
rotund token
errant hawk
misty wedge
rotund token
misty wedge
errant hawk
#

tf

misty wedge
#

Wow, adam driver is not allowed

rotund token
#

im running at 1.8fps

#

so i dont think lag is the issue

misty wedge
errant hawk
rotund token
#

havok isn't supported in 1.0 yet i didn't think

#

not coming till preview stage

errant hawk
#

ugh

misty wedge
#

The editor support requires using Unity.Graphics I assume?

errant hawk
#

that's a plane right?

rotund token
#

yes

misty wedge
#

e.g. clicking a thing

rotund token
#

the only thing i can think of is i enabled live conversion

errant hawk
rotund token
#

you have to enable internal mode

#

for the option to appear

#

if you enabled it in earlier entities it might already be on (im not sure, mine wasn't)

#

sorry "Live baking"

devout prairie
errant hawk
rotund token
#

in help -> about

#

type internal

misty wedge
errant hawk
#

there's nothing in about

rotund token
#

actually let me just turn it off and see if it breaks

#

seems easier

misty wedge
#

You need to type internal

#

In the window

#

like a konami code

errant hawk
#

wait what

misty wedge
#

????

rotund token
#

yeah literally just type internal

errant hawk
#

tf why

rotund token
#

nah turning it off changes nothing

errant hawk
#

why does this exist

rotund token
#

this option shouldn't have been marked internal

#

but conveniently there's an easy way for us to just access it

misty wedge
#

What does typing internal do in that window?

errant hawk
#

oh typing internal into about allows access to internal settings?

misty wedge
#

WAS I JUST HACKED?

rotund token
#

(annoying circles)

errant hawk
#

also Live Baking was already on

rotund token
devout prairie
misty wedge
rotund token
#

no

misty wedge
errant hawk
#

so how did you find it?

rotund token
#

i just searched through source code and noticed an editorpref that i could set to enable this internal mode

#

mentioned it and a unity dev said you could just type internal instead

errant hawk
#

oh lmao

errant hawk
misty wedge
#

Your wheel didn't fit the scheme

errant hawk
viral sonnet
misty wedge
errant hawk
misty wedge
viral sonnet
errant hawk
misty wedge
misty wedge
devout prairie
#

I think tertle had to call a premium rate number to get that code

proud jackal
errant hawk
viral sonnet
#

first thing to figure out. why does this happen: ArgumentException: Unity.Entities.PostLoadCommandBuffer is a class based IComponentData. Class based IComponentData must implement a default constructor. at Unity.Entities.TypeManager.ThrowOnDisallowedManagedComponentData (System.Type type, System.Type baseType, System.String baseTypeDesc) [0x0001e] in <7d1df35eee734686aa0e124eb644d3f7>:0 at Unity.Entities.TypeManager.CheckIsAllowedAsManagedComponentData (System.Type type, System.String baseTypeDesc, System.Collections.Generic.HashSet`1[T] nestedContainerCache) [0x0001a] in <7d1df35eee734686aa0e124eb644d3f7>:0 at Unity.Entities.TypeManager.BuildComponentType (System.Type type, Unity.Entities.TypeIndex[] writeGroups, System.Collections.Generic.Dictionary`2[TKey,TValue] hashCache, System.Collections.Generic.HashSet`1[T] nestedContainerCache) [0x00112] in <7d1df35eee734686aa0e124eb644d3f7>:0 at Unity.Entities.TypeManager.BuildComponentType (System.Type type, System.Collections.Generic.Dictionary`2[TKey,TValue] hashCache, System.Collections.Generic.HashSet`1[T] nestedContainerCache) [0x00000] in <7d1df35eee734686aa0e124eb644d3f7>:0 at Unity.Entities.TypeManager.AddAllComponentTypes (System.Type[] componentTypes, System.Int32 startTypeIndex, System.Collections.Generic.Dictionary`2[TKey,TValue] writeGroupByType, System.Collections.Generic.Dictionary`2[TKey,TValue] descendantCountByType) [0x00072] in <7d1df35eee734686aa0e124eb644d3f7>:0

rotund token
#

oh yeah i got none of those either

#

are you on b8 or b9?

misty wedge
errant hawk
misty wedge
viral sonnet
#

yeah, physics samples log is also totally clean. have tried in b8 and b9 now.

errant hawk
viral sonnet
misty wedge
errant hawk
#

I figured it was just for packages

misty wedge
#

I even deleted the global package cache

#

I even reinstalled the OS

errant hawk
devout prairie
#

Did you switch it off and back on again?

misty wedge
viral sonnet
devout prairie
viral sonnet
#

lots of "Missing default ctor" after the error

misty wedge
devout prairie
errant hawk
rotund token
#

@viral sonnet what strip level is selected

viral sonnet
#

strip level is low

rotund token
#

yeah i have none of that in my log

errant hawk
rotund token
misty wedge
rotund token
#

hes building mono isn't he

#

yes in il2cpp low is min, but in mono you can select none

misty wedge
#

Ah, I thought he was building il2cpp

viral sonnet
#

i built both but i'm trying mono now. if mono works, il2cpp will work too

rotund token
#

(i wouldn't go that far, known il2cpp specific crashes at 3 now)

errant hawk
#

(@rotund token can tell you all about the conflict between mono and il2cpp)

viral sonnet
#

empty scene also doesn't work πŸ˜„

rotund token
#

This crash is a known issue. It has already been fixed, but sadly it did not make it before the cutoff. Should be fixed in 2022.2.0b10.
graphics crash from forum

errant hawk
#

haha

#

hahaha

#

"what one"

errant hawk
rotund token
#

oh nothing much more than i posted above

misty wedge
rotund token
#

i reported a crash to unity with a small repo day 1 of entities 1.0

misty wedge
#

Between two runs the order is the same for me though

rotund token
#

2 days later they got back to me after tracking it down and posted that explanation

rotund token
#

so ah

#

turn off stripping to fix?

#

i repo everything

#

ArgumentException: Unity.Entities.PostLoadCommandBuffer is a class based IComponentData. Class based IComponentData must implement a default constructor.

viral sonnet
#

i was about to write. empty scene loaded now with stripping disabled

rotund token
#

Missing default ctor on Unity.Physics.Authoring.BeginColliderConversionSystem (or if you don't want this to be auto-creatable, tag it with [DisableAutoCreation])

#

etc

viral sonnet
#

let's see about the rest

rotund token
#

the crash in entityquery

misty wedge
rotund token
#

yes

misty wedge
#

eugh

rotund token
#

if i turn on stripping

#

it crashes/errors/etc

misty wedge
#

lame

#

boo

#

I'm guessing any call to GetSingletonChunk crashes it then and BroadphaseSystem is just the first one

viral sonnet
#

success! πŸ˜„ game works again

#

now onto il2cpp

#

hm, that was already on minimal. not good πŸ˜„

rotund token
#

you cant go less than minimal

#

for il2cpp

errant hawk
misty wedge
#

Yeah

viral sonnet
#

and faster(smaller) builds

#

so uhm, il2cpp is screwed now? πŸ˜„

errant hawk
rotund token
#

why

viral sonnet
#

i was getting the same errors/results

rotund token
#

oh i get you

#

nah the stripping level was probably on low before

#

its shared between mono/il2cpp

viral sonnet
#

ok, testing right now

rotund token
#

it just removes the none option when you switch to il2cpp

misty wedge
#

When did they add a Minimal stripping level? I swear that wasn't always there

viral sonnet
#

what's the default stripping level? i can't remember ever changing that

misty wedge
#

It only strips GetSingletonChunk, nothing else thonk

misty wedge
#

It could've also been Medium or High

misty wedge
misty wedge
rotund token
#

yeah that is what mine was on by default

viral sonnet
#

well, at least it crashes somewhere else now πŸ˜„ how can i figure out what this is IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SystemBase_Update_m795994EE60C054DFA78C313A60ED025B2668C9B4 (SystemBase_tF1D148F181415A7A0A38555F7FAD20D5D33C0F0D* __this, const RuntimeMethod* method) does the pdb help?

balmy thistle
#

What's the editor version?

viral sonnet
#

2022.2.0b9

misty wedge
viral sonnet
#

haha right πŸ˜„

errant hawk
misty wedge
#

I know, I was joking πŸ˜›

errant hawk
#

imagine if he was using 2020 lmao

misty wedge
#

I'm actually on 5.6 atm...

viral sonnet
#

simpler times

misty wedge
#

I remember using the first "multiplayer" system, that was nuts

raw mica
viral sonnet
#

i just got mono to run. now a crash in il2cpp. probably related to something i'm doing wrong πŸ˜„

misty wedge
viral sonnet
#

lowering the stripping level fixed the physics crash

misty wedge
#

down to Minimal?

viral sonnet
#

yes

misty wedge
#

Interesting

balmy thistle
#

It's possible you're being affected by an unrelated il2cpp bug which is what we're checking.

viral sonnet
#

thanks, very appreciated!

errant hawk
#

nah it's @viral sonnet

misty wedge
#

Damn there's a cats discord server, time to join

errant hawk
raw mica
#

Drats looks like you too are hitting the IL2CPP crash due to the bug found recently. IL2CPP miscalculates the size of components when they contain a BlobAssetReference in them by miscalculating the alignment of BlobAssetReference to be 1 instead of 8 bytes

misty wedge
errant hawk
viral sonnet
#

alright, thanks. i've read about it from tertle but didn't get around in checking if i'm affected

#

thanks for the heads up

raw mica
#

You can work around the issue by forcing your BlobAssetReference component type size to be a multiple of 8.

The IL2CPP bug has been fixed internally so the fix is en route to the world as fast as it can.

viral sonnet
#

all good, i'll wait for the fix. should be in b10, right?

misty wedge
#

Why does it crash in Unity.Physics.BroadphaseSystem?

#

Oh, you are referring to the runtime issue from @viral sonnet , my bad

raw mica
viral sonnet
#

can you also take a note about this (#archived-dots message) - this errors appears in mono builds with a stripping level higher than "Disabled"

rotund token
#

I also tried setting struct size manually with struct layout to 16 and no ball

#

Was about to test splitting component into 2 (for this specific case it should be anyway, I just tacked it on due to laziness)

misty wedge
#

Any idea how this can happen?

NullReferenceException: Object reference not set to an instance of an object
  at Unity.Entities.EntityQueryImpl.GetSingleton[T] () [0x00053] in C:\Users\Linus\Repositories\DireSpark\Library\PackageCache\com.unity.entities@1.0.0-exp.8\Unity.Entities\Iterators\EntityQuery.cs:1524 
  at Unity.Entities.EntityQuery.GetSingleton[T] () [0x00000] in C:\Users\Linus\Repositories\DireSpark\Library\PackageCache\com.unity.entities@1.0.0-exp.8\Unity.Entities\Iterators\EntityQuery.cs:2752 
viral sonnet
#

hm, seems like the singleton you want to query doesn't exist? is that also coming from physics?

rotund token
#

I have no urgency on a viable il2cpp build so as long as a fix is on the way I might just leave it for now

misty wedge
raw mica
#

I'm not involved with the release process but it does look like b10 should contain the fix -- but no firm promise.

I've noted the stripping issues. We'll take a look at it as it seems like a bug on our end with some dynamic lookups and some unnecessary restrictions for managed component instantiation

viral sonnet
misty wedge
#

It's weird because it works in the editor, this is an error I only get in a build

viral sonnet
#

debug.log to make sure it exists.

misty wedge
#

Tomorrow, it's time to sleep now. I thank everyone for participating in this journey, and bid thee farewell

viral sonnet
#

have a good night

#

thanks to the unity devs that spare their time for us on the weekend! πŸ‘‘

raw mica
#

No problemo πŸ™‚

#

Thanks for raising issues so we can fix them πŸ™‚

viral sonnet
#

how can i get the system entity? am i missing an implicit conversion of systemHandle? the entity in there is internal.

#

oh, most methods have a SystemHandle parameter now. ok then πŸ™‚

proud jackal
#

There will be a doc about it but essentially most of the important methods have SystemHandle alternatives :3

rotund token
#

related design question, i noticed entity command buffer systems don't use the system entity and instead create a new entity for the singleton you access

#

what's the reasoning behind this and when should i use the existing entity vs creating a new one

proud jackal
#

Sounds like a question for Kevin if he's still here, since tmk it's more historical than for efficiencies, as when ecbsystems became a singleton System entities were not there yet :3

rotund token
#

ok was kind of what i was thinking just wanted to be sure

#

it currently does something like

ref var s = ref system.GetSingletonRW<T>().ValueRW;```
and I could just change it to something like this for my own uses
```world.EntityManager.AddComponent(system.SystemHandle, ComponentType.ReadWrite<T>());
ref var s = ref system.GetSingletonRW<T>().ValueRW;```
proud jackal
#

yup, and would likely be more efficient as well, since it causes one less structural change ish.

viral sonnet
#

my 2 cents on this is that they implemented a struct with helper methods which makes for a very nice usage with var ecbSingleton = SystemAPI.GetSingleton<EndSimulationEntityCommandBufferSystem.Singleton>(); var ecb = ecbSingleton.CreateCommandBuffer(state.WorldUnmanaged); not only that, it's also strongly typed. otherwise we would need the SystemHandle first

rotund token
#

it doesn't change the implementation of how you access it - it's still a singleton component

proud jackal
#

The type would still be there, it's simply an internal implementation detail of where the Singleton is stored :3

rotund token
#

good good, after i finish these last updates my objective is to switch a few things to work similar to this for a consistent experience

viral sonnet
#

playing around with right now and wanted to move out a static id from the archetype because it's just used for saving. wrote this: ```public partial struct AvatarIDLookupSystem : ISystem
{
public struct Singleton : IComponentData
{
public NativeHashMap<Entity, int> avatarIdLookup;
}

    public void OnCreate(ref SystemState state)
    {
        if (!state.EntityManager.AddComponent(state.SystemHandle, typeof(Singleton)))
        {
            Debug.Log($"Error creating AvatarIDLookupSystem singleton!");
            return;
        }
        
        ref var comp = ref SystemAPI.GetSingletonRW<Singleton>().ValueRW;
            
        comp = new Singleton()
        {
            avatarIdLookup = new NativeHashMap<Entity, int>(0, Allocator.Persistent)
        };
    }
}``` seems pretty nice to just call AvatarIDLookupSystem.Singleton from anywhere and get the lookup hashmap
rotund token
#

(i assume you have a dispose routine in this system as well)

viral sonnet
#

sure thing πŸ™‚

#

i'm starting to like singletons a lot. have already rewritten a bunch of very weird dependencies around systems and init timings of runtime data. now that NativeContainers can fit in a struct IComp it's even better

rotund token
#

pre-1.0 i was pretty anti allocated memory on containers

#

but this api makes it a very viable option

viral sonnet
#

huh? can you rephrase?

rotund token
#

by allocated memory i mean Allocator.X

#

unsafe containers obviously at that point

viral sonnet
#

yeah got you. it was a bit weird to handle

rotund token
#

im probably still against it on non-singleton entities but we'll see

viral sonnet
#

yeah i also haven't opened up to the idea to use nativeContainers inside IComps/on more than 1 entity. i rather handle this another way

#

nasty random access. inlined DBs are better for this

errant hawk
#

What's the purpose of singletons? (I know what they are, im specifically referring to entities use-case)

rotund token
#

think entity command buffers systems now

#

but i have other usages i'm going to be setup

#

my navmeshworld will exist on a singleton

#

so any system can safely query the mesh

#

i have a draw library etc that will utilize it

#

my navmeshbworld already exists on an IComponentData - I just want to make some tweaks to be more consistent with the new API

viral sonnet
#

there are a lot of use cases. previously they were mostly just used to trigger updates on systems. set something up, then the system knows it can run safely. but now it's also very viable to move any data out of a system and we don't need to get system references. all a bit more streamlined

#

hope the excessive usage of queries is not a problem πŸ˜„

errant hawk
#

so singletons are just ECB, but for systems?

rotund token
#

hoping ISystem handles it well enough

proud jackal
#

Oh and pro tip: GetSingleton does no syncing since the core usecase is containers/cross system com, as a result many jobs can read from a singleton at the same time :3

rotund token
#

(GetSingletonRW does though right?)

proud jackal
#

Yup, obvoiusly can't be sure when you set values, but hopefully you don't set values often on singletons, since they do sync jobs from systems using the type πŸ˜›

rotund token
#

i'd probably just GetSingletonEntity and write it in the job to avoid that but good to check

viral sonnet
#

a singleton is an IComp that exists once. that's about it. ECB just uses the design principle now which enabled us to use ECBS in ISystem

errant hawk
#

I try to avoid the singleton paradigm, mostly because it's a terrible pattern to implement

#

so im trying to figure out the use case in ECS

rotund token
#

i think these singletons are quite a bit less problematic than oop singleton

#

at least until we all start abusing them 😈

viral sonnet
#

we get an error when 2 singleton comps exist so, all good in terms of safety

rotund token
#

they're singleton per world which is already a huge advantage so you can have more than 1 in an app

#

it doesn't just break down when you are like testing thin clients and stuff

viral sonnet
#

oh right, that's also nice

proud jackal
#

Haha, well, the ecs singleton in entities can essentially be thought of as a Single query. It ensure there's just one result. and the one thing singletons in ecs land does extra is that .GetSingleton does no syncing. (But they bare next to no resemblance to original patterned singletons present in OOP books)

viral sonnet
rotund token
#

a classic case of singletons with gameobjects falling apart is you create a single player game and you decide to make it multiplayer - now your client/server both depend on the same singleton. then you want to stress test multiple clients...

viral sonnet
#

off to bed now. have a good night or day o/

errant hawk
errant hawk
#

I mean, I would rename a lot of the API's naming convention if I had my way hehe πŸ˜›

viral sonnet
#

would you rather call them SinglePerWorldton?

rotund token
#

SystemAPI.GetSingleUniqueComponentPerWorld<T>()

proud jackal
#

That's been an internal discussion for a WHILE, singletons are defintly one of the api's we likely want to give an overhaul of (and now that we're nearing 1.0) that will instead come with the slow out phasing path so everyone can depent on our stuff without being scared of deprecations :3 (for instance it was discussed to just rename them singles but like EntitiesForEach we chose to keep them to not break users further)

errant hawk
#

punish us like the filth we are

errant hawk
#

I think small API changes are fine. And when I mean "small" I'm talking readability, rational name changes to methods, etc.
I would have named methods like GetComponentLoopup<T>() as simply GetComponent<T>(). Yes it conflicts with GameObject.GetComponent but that's kind of the point, to be similar.
Also, GetComponent would return a Component<T> type. getting and setting could be literally just someComponent.Get(someEntity), someComponent.Set(value), someComponent.TryGet(someEntity), etc.

rotund token
#

GetComponentLoopup<T>() as simply GetComponent<T>()
it conflicts with GetComponent

#

that already exists

#

hmmmmmmmmm
are all unmanaged shared components negative index and all managed shared components positive index? or is this just a small sample size from me

errant hawk
rotund token
#

im saying that SystemBase/EntityManager already have a GetComponent method

rotund token
# rotund token hmmmmmmmmm are all unmanaged shared components negative index and all managed sh...

what i'm trying to do here is basically update my TryGetSharedComponentInFilter method

            where T : struct, ISharedComponentData
        {
            var impl = query._GetImpl();

            AssertRange(index, impl->_Filter.Shared.Count);

            var scdIndex = impl->_Filter.Shared.SharedComponentIndex[index];
            var scd = entityManager.GetSharedComponentDataNonDefaultBoxed(scdIndex);

            if (scd is T component)
            {
                sharedComponent = component;
                return true;
            }

            sharedComponent = default;
            return false;
        }
#

which is getting a shared component from an entity query (for validation)

#

but my var scdIndex = impl->_Filter.Shared.SharedComponentIndex[index]; now returns negatives because well components can be unmanaged

#

so I need to determine if the shared component index is managed or unmanaged

#

this is purely used to verify someone hasn't screwed up the entityquery
Assert.IsTrue(query.TryGetSharedComponentInFilter<SceneSection>(this.System.EntityManager, 0, out _), "A SceneSection SharedComponentFilter has been overridden incorrectly.");

#

basically i just need to verify element 0 in a entityquery is SceneSection

#

i think what i need to use now is EntityComponentStore.GetSharedComponentData_Unmanaged

#

hmm no that requires TypeIndex

#

basically, need to turn sharedComponentIndex into a typeindex

rustic rain
#

Hmm

#

Can't you just access shared component as object

#

And then get type?

rotund token
#

well that's what i was doing

#

but i'm getting negative scd indices for unmanaged types

        {
            Assert.AreNotEqual(0, index);
            return m_SharedComponentData[index];
        }```
#

hence it's failing

#

anyway i've simplified this a lot

rustic rain
#

Huh

#

I guess they are stored in different arrays?

#

And negative should just be brought to abs

#

To the other array?

#

No idea if that's true, but that's how Id do it

rotund token
#

i dont know if they're always negative

#

hence i was asking

#

my sample size is 1

#
            where T : struct, ISharedComponentData
        {
            var filters = query.GetSharedFilters();
            var requiredType = TypeManager.GetTypeIndex<T>();

            for (var i = 0; i < filters.Count; i++)
            {
                var indexInEntityQuery = filters.IndexInEntityQuery[i];
                var component = query.__impl->_QueryData->RequiredComponents[indexInEntityQuery].TypeIndex;
                if (component == requiredType)
                {
                    scdIndex = filters.SharedComponentIndex[i];
                    return true;
                }
            }

            scdIndex = -1;
            return false;
        }

anyway i just simplified it to grab the typeindex from the query

late mural
#

i feel like im doing something very stupidly, but im not quite certain what, so basically im trying to create a native array of ParticleSystem.Particle, then i want to set the positions of indices 0 and 1 to be something, but of course they aint variables, but if i try create local copies of them i dont really know how to set the original native array to have those changes, guessing im missing something lol

rotund token
#

there's a ParticleSystem.GetParticles(NativeArray<ParticleSystem.Particle>) method

#

you can get the particles

#

manipulate it

#

then write it back with SetParticles

#

public partial class SavableConversionSystem : GameObjectConversionSystem
classic
debugging why my code isn't working

#

left my updating of conversion systems half done yesterday when i logged off....

late mural
# rotund token can't particle system just return this for you?

unfortunately i cant really do that, im trying to avoid some consequences of using dots to manipulate the particle system, and getting the particles is not really required, infact it makes it slower, plus it still doesnt solve my problem of needing to set the first 2 indices to have a specific position

rotund token
#

im confused

#

you say you want to use native array

late mural
#

i actually set all the positions later on, using the specific intended dots way of touching the particles system, unfortunately this breaks the bounds, and causes rendering to mess up, hence why i need to set the position now, in a weird way so i can trick the rendering system into working correctly

#

it sounds stupid and is stupid

rotund token
#

im not really sure what this has to do with dots though

late mural
#

native arrays are dots right?

rotund token
#

i mean sure

#

but if you're not using a job

#

why use a native array

#

return it as a normal array

late mural
#

normal arrays cant be manually disposed of as far as im aware

rotund token
#

they don't need to be disposed

#

the GC handles that for you

late mural
#

the garbage collecter struggles with incremental destruction of 70 thousand length arrays

rotund token
#

does it?

late mural
#

native arrays are an experiment im trying now, to see if manual disposal might help avoid these huge spikes

late mural
#

every 5 seconds i get a half a second of 2 fps

rotund token
#

then pool and reuse them

late mural
#

im not very familiar with pools, how exactly would this work with an array?

rotund token
#

just means to re-use the array each time you need to get it

#

but ok use native arrays

late mural
#

unfortunately the array changes size every time the particle system gets updated

rotund token
#

i'm still struggling to understand your problem

late mural
rotund token
late mural
#

im doing fluid physics, the amount of particles is controlled by nvidia flex

#

the way i set particles is stupid slow

#

and there is in theory a faster way

#

but i cant work out how for the life of me

#

the cursed garbage collecter is determined to collect the arrays

#

it would be nice to create one array the size of the max number of particles, and then just grab chunks of that array without copying it and use that, but this appears impossible

rustic rain
late mural
rustic rain
#

Simply create new array on demand if it gets bigger

late mural
#

ok i can work that part out, but how do i grab a chunk of it?

rotund token
late mural
#

so say i have an array of 1000 length, and i need to set 500 particles, then logically assuming black magic of chunk grabbing, it would be really nice to just say use half the array, or something like that, so gc only needs to clear the array on ending play mode

#

this appears impossible though

#

anyway, this is nolonger becoming a dots question too much though, so imma try move this question over to the particle system channel, thanks for all the help yall

late mural
rotund token
#

int GetParticles(ParticleSystem.Particle[] particles, int size, int offset);

late mural
#

unfortunately i dont need to get particles

rotund token
#

there's an overload for this

#

void SetParticles(ParticleSystem.Particle[] particles, int size, int offset);

late mural
#

ooh

rotund token
#

void SetParticles(particles, int size) => this.SetParticles(particles, size, 0);

late mural
narrow scaffold
#

I'm trying to upgrade my project to Entities 1.0 and for some reason I can't get Rider to import LocalToWorldTransform . Other structs from the same package (for example UniformScaleTransform ) import fine. Did anyone encounter an issue like this?

I already double checked that the package import went fine and even did a reimport all so that shouldn't be the problem.
Fyi: I upgraded by changing the version numbers for entities, phyics and graphics in the manifest.json.

rotund token
#

UniformScaleTransform won't exist if you have physics or netcode package installed

#

they don't support new transform system yet so forces V1 for now

narrow scaffold
#

Okay then I guess I will have to enable V1 again for now

rotund token
#

shoudl already be enabled

narrow scaffold
#

Don't I have to add the scripting symbol ENABLE_TRANSFORM_V1

rotund token
#

yeah it doesn't matter

#

i am super confused what's going on here, i have a bunch of subscenes marked NOT auto load scene

#

but starting game, half of them get loaded anyway...

rustic rain
#

Bruuuuuh

#

even with ICustomBootstrap

#

I can't start my game

#

Hierarchy windows is just broken

rotund token
#

why does that stop you starting your game?

rustic rain
#

because it relies on entities

#

πŸ™ƒ

rotund token
#

oh

#

just use a debugger?

#

(what's your error anyway)

rustic rain
# rotund token (what's your error anyway)

ArgumentException: A component with type:Unity.Scenes.SubScene has not been added to the entity. Entities Journaling may be able to help determine more information. Please enable Entities Journaling for a more helpful error message.

rotund token
#

oh

#

i can probably tell you the problem

#

you are creating entities during conversion from a baking system

rustic rain
#

my baking systems only add components

rotund token
#

hmm πŸ€·β€β™‚οΈ

#

i have a similar issue atm and it was from creating entities in baking systems

#

oh wait that was subscene section

#

on an entity

#

hmm this is subscene?

#

sounds like a subscene isn't converting properly

rustic rain
#

it shows well outside of PlayMode

#

but as soon as I press it - ded

#

no play mode

#

play mode

#

don't mind convert to entity system
It doesn't work without it either

rotund token
#

stars seems the problem?

sharp stump
#

I searched through the history to see if this has been discussed, but I didn't see it addressed here, so I hope I am not retreading old ground on this, but I have a question about 1.0. What does 1.0 mean to Unity? I know what it means to me, but I am not sure if it means the same to Unity.

#

To me it should mean that the core architecture of the system is defined and won't make major shifts away from what is available in 1.0 until there is a 2.0. Is that what it means from Unity's perspective

sharp stump
#

but I mean in more real low level technical terms

#

Have the said "here are the locked features/paradigms" or does production ready mean something less specific?

#

I ask because I have kind of been treating 1.0 as the green flag to start the race if you know what I mean, and I just want to know that I won't get rug pulled πŸ˜„

narrow scaffold
#

Anyone know how to remove components in a Baker?

rustic rain
#

to entity

#

and remove all components you want on entities that have this tag

narrow scaffold
#

Good solution thanks

brave field
#

Is there's any define to activate old conversation instead of baker at dots 1.0 preview? Currently I would like to see my project upgrade working properly first before fully migrate to baker

sharp stump
elfin spire
rustic rain
#

if only it worked πŸ‘΄

elfin spire
#

haha

#

v1.0.1

haughty rampart
#

(not dots related but i'm going crazy)
when unity imports assets, e.g. an image, they create a .meta file for the asset, this .meta file can contain a lot of extra properties.
i am writing a custom importer and would like to add some to the .meta file too. does anyone know how to do that? i've found absolutely nothing

raw mica
raw mica
safe lintel
#

I feel that this or the next preview should really error on any old conversion stuff, make it clear that conversion is dead in favour of baking

haughty rampart
# raw mica I believe the mechanism is the `userData` field for your importer. https://docs...

well, at first i thought this would be the thing, but it being string threw me off immensely.
but no. turs out, what you actually want to store data in .meta is: save the data as serializable data in fields inside your custom importer class. damn. that is important information that is just missing from the docs. (i guess, you could make the assumption that this happens if you've previously inspected some game-object's .meta, but even then i'd say it's kinda a stretch to assume this maps approximately to custom importers and editor only things too.)
many thanks for your help though. even if it wasn't actually the solution i was looking for

raw mica
#

Thanks for the feedback ,I can pass it along to the importer team to see if they can clarify the docs (or point me to where it is documented) πŸ™‚

haughty rampart
#

πŸ‘

coarse turtle
#

Has anyone ran into an issue where the TransformSystemGroup (v2) isn't being added? I end up getting these logs in a mono build:
A system Unity.Transforms.TransformToMatrixSystem could not be added to group Unity.Transforms.TransformSystemGroup, because the group was not created. Fix these errors before continuing. The system will not be added to any group and thus not update.

stiff mesa
#

Hey everyone! I have a question about the blob assets. Let's imagine that I have an entity with a component containing BlobAssetReference. Do I have to dispose it manually or can I just destroy the entity itself and it will manage the disposal of the BlobAssetReference automatically?

rotund token
#

Blob asset memory is handle for you as long as you set it up during conversion in a subscene

whole gyro
#

@viral sonnet I remember you were having trouble with trying to disable an IEnableableComponent in baker/baking system. Were you able to get it working in a baking system? Also, did any unity dev say whether or not the lack of a Baker<>.SetComponentEnabled() was an oversight or not?

stiff mesa
#

So, I have to use SubScene in order for it to work, right?

viral sonnet
whole gyro
coarse turtle
viral sonnet
viral sonnet
whole gyro
#

I have quite a few components that I use to trigger things. These are components with a single bool field that is false by default. When set true, it triggers some behavior. I was hoping to use IEnableableComponent for this, but having to disable them after instantiating a prefab will be very annoying. And I'd rather not have to invert all of my components to make a disabled component trigger the behavior

viral sonnet
#

SetComponentEnabled: <remarks> Behavior at Playback: Will throw an error if this entity is destroyed before playback, if this entity is still deferred, if the entity has the <see cref="Prefab"/> tag, or if the entity doesn't have the component type.</remarks> so no prefab support

#

i hope it's an oversight. something like that should not be a constraint. and yeah, inverting logic is annoying

whole gyro
#

Do you get the same error when you disable directly with an EntityManager instead of an ECB?

viral sonnet
#

my preliminary notes on entities 1.0 ```baker:

  • no removeComponent
  • can't set IEnableComponent to default false
  • no direct way of removing LinkedEntityGroup (needs internal access and YABS - yet another baking system)
  • generic bakers throws errors after recompile (still works 100%)
  • no easy generic bakers, needs base class
  • holding down CTRL+D on a GO with baker component creates chunks for every new gameobject (needs open/close or reimport of the subscene)

codegen:

  • namespaces are missing in 2nd partial struct
  • SystemAPI can't query MBs

dots hierarchy:

  • GameObjectChangeTracker stalls when instantiating gameobjects (in my case 3 every 2 frames)

builds:

  • misaligned bytes with BlobAssetReference (fix in Unity 2022.2.0b10 or b11)```
viral sonnet
whole gyro
#

The comments for EntityManager.SetComponentEnabled() don't say anything about this limitation:

        /// <summary>
        /// Enable or disable a <see cref="ComponentType"/> on the specified <see cref="Entity"/>.
        /// </summary>
        /// <remarks>
        /// This operation does not cause a structural change, and does not affect the current value of the component.
        ///
        /// An entity with a disabled component will not match an <see cref="EntityQuery"/> that requires that component,
        /// and will match a query that excludes that component.
        ///
        /// To enable/disable components from a job, use <see cref="ComponentLookup{T}.SetComponentEnabled(Entity,bool)"/>.
        /// To enable/disable an entire <see cref="Entity"/>, use <see cref="SetEnabled(Entity,bool)"/> (which, unlike this function,
        /// does involve a structural change).
        /// </remarks>
        /// <exception cref="ArgumentException">The <see cref="Entity"/> does not exist.</exception>
        /// <typeparam name="T">The component type to enable or disable. This type must implement the
        /// <see cref="IEnableableComponent"/> interface.</typeparam>
        /// <param name="entity">The entity whose component should be enabled or disabled.</param>
        /// <param name="value">True if the specified component should be enabled, or false if it should be disabled.</param>
        /// <seealso cref="IsComponentEnabled{T}(Entity)"/>
        /// <seealso cref="ComponentLookup{T}.SetComponentEnabled(Entity,bool)"/>
#

I'll have to test this later today

coarse turtle
frosty siren
rustic rain
#

internal stuff keeps you away from complex stuff

#

but if you want it anyway

#

you get it very simply

frosty siren
#

yeah, just use assembly with unsafe mode

frosty siren
# rustic rain internal stuff keeps you away from complex stuff

and yes, i agree with you about keeping clients away from details they can break and get unexpected hard-to-understand result. But IMHO that is applicable when we deal with black box solutions, which we have near to zero need to get under the hood. But with unity's ECS we often need to use such components with custom constructed entities.
For example i want to make custom procedurally constructed set of linked entities so i can instantiate/destroy them cascadly. In 0.17 you just simply use LEG (yes you should not forget about adding entity itself to LEG as element, which is breakable part) and voila. Now for each separate asmdef which wants to make this trick i need to enable unsafe code to access internal stuff

whole gyro
#

Regarding IEnableableComponent and Baker, I was hoping for there to be some way so that disabling a MonoBehaviour on a game object would disable the IEnableableComponent on the baked entity. Looks like the baker already has support for taking a dependency on the enabled state of the MonoBehaviour (Baker<>.IsActiveAndEnabled()) so we just need a Baker.SetComponentEnabled() to make this work.

rustic rain
viral sonnet
#

still, you need internal access to prevent LEG on prefabs

frosty siren
viral sonnet
#

np, don't expect everyone to understand my notes πŸ˜…

viral sonnet
#

that way unity can set this up and we don't need additional code

whole gyro
whole gyro
misty wedge
#

Nobody has any idea what this is right? It's driving me absolutely nuts
Asset has disappeared while building player to 'globalgamemanagers.assets' - path '', instancedID '-3602' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

viral sonnet
errant hawk
#

@raw mica is it alright if I post the message to the bug report I sent you?

#

(for others to understand what is the cause, and the best solution for the time being)

raw mica
#

Sure thing!

errant hawk
#

I submitted a bug report and this is what @raw mica replied with (edited for readability/emphasis):

Thanks! Looks like the TypeManage in Unity.Entities.dll is not halting the build when invalid components are found. This is leading to their use even though the are not setup correctly and due to the nature of how some methods can be Burst compiled, this can lead to crashes. e.g. In this case there are some components that are not default constructible that need to be fixed ArgumentException: Development.ECS.Components.FollowerTarget is a class based IComponentData. Class based IComponentData must implement a default constructor. We’ll fix this in our next release of com.unity.entities. In the meanwhile looking in your Editor.Log for ArgumentExceptions before the crash should highlight the invalid components to fix your build locally. Hope this helps! Kev

misty wedge
#

I have a mono build that crashes immediately even though unity reported a successful build, should I submit something like this?

#

I don't think it has to do anything with the project itself, since sometimes it will build correctly, but sometimes this happens and it crashes immediately

#

I think the incremental build pipeline might break or something

frosty siren
#

Anyone know any doc to read about ISystem? i'm trying to touch this thing, but can't figure out how to work with this like with normal SystemBase

misty wedge
frosty siren
misty wedge
frosty siren
misty wedge
#

You can't, those are managed

#

You can only get a SystemHandle or SystemState

#

I guess in theory they could could return a ref to the system struct, but I don't think you can currently do that (and it's probably not recommended as a design)

viral sonnet
#

do you need a property from the managed system?

misty wedge
#

What an incredibly weird callstack for a crash

#

This is the callstack for when it crashes before even reaching the splash screen, incredibly strange

rotund token
#

splash screen

#

odd

misty wedge
#

Yep

raw mica
misty wedge
# raw mica Yes please, crashing while drawing the splash screen is a bit surprising, especi...

The completed build always crashes before the splash screen, but when building the same project, sometimes it will fail completely, giving me this:
Asset has disappeared while building player to 'globalgamemanagers.assets' - path '', instancedID '-3602' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&). This happens about 90% of the time, you can imagine how frustrating that is. Sometimes if I'm lucky, after deleting the library and global cache, and the reimport loads, if I immediately build, there's a 50/50 chance I either get a build that crashes before the splash screen, or a build that works normally.

rotund token
#

Is there anyway to debug leaks within baking?

[Worker5] Internal: There are remaining Allocations on the JobTempAlloc. This is a leak, and will impact performance
Getting a random leak but higher leak detection doesn't seem to provide any info

#

The thing is, I also have 0 usages of TempJob which is making this even harder to figure out

raw mica
#

You can enable tempjob leak tracking in the editor diagnostics menu from Preferences

#

(you'll need to restart the editor after)

rotund token
#

Will give that a shot thanks

#

haha well that's fun

0x00007ff657676371 (Unity) BatchRendererGroup::~BatchRendererGroup
0x00007ff6576789df (Unity) BatchRendererGroup::Destroy
0x00007ff656d03d08 (Unity) BatchRendererGroup_CUSTOM_Destroy
0x0000028631545d61 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Rendering.BatchRendererGroup:Destroy (intptr)
0x0000028631545bdb (Mono JIT Code) UnityEngine.Rendering.BatchRendererGroup:Dispose ()
0x0000028631543ebb (Mono JIT Code) [EntitiesGraphicsSystem.cs:1186] Unity.Rendering.EntitiesGraphicsSystem:Dispose () 
0x0000028631543aab (Mono JIT Code) [EntitiesGraphicsSystem.cs:963] Unity.Rendering.EntitiesGraphicsSystem:OnDestroy () 
0x0000028631524d60 (Mono JIT Code) [ComponentSystemBase.cs:281] Unity.Entities.ComponentSystemBase:OnDestroy_Internal () 
0x0000028631523803 (Mono JIT Code) [World.cs:1001] Unity.Entities.World:DestroyAllSystemsAndLogException () 
0x0000028631520c43 (Mono JIT Code) [World.cs:303] Unity.Entities.World:Dispose () 
0x000002863151fb33 (Mono JIT Code) [World.cs:329] Unity.Entities.World:DisposeAllWorlds () 
0x000002863151d7c3 (Mono JIT Code) [DefaultWorldInitialization.cs:101] Unity.Entities.DefaultWorldInitialization:DomainUnloadOrPlayModeChangeShutdown () ```
#

a) it stopped leaking on the unity restart after turning on the debugging
b) entering play mode just crashed from cleanup of editor world

#

yeah 100% repo on this crash of editor

#

with these 3 enabled
TempMemoryLeakValidation: True
JobTempMemoryLeakValidation: True
ForceDebugAllocator: True

#

just going to turn them off to make sure it was this cause and not just a coincidence

raw mica
#

Does the crash keep happening if burst is off? There is a vaguely listed known issue on the release post about burst compilation when entering playmode causing crashes

rotund token
#

turning all 3 off, restarting, no longer crashes

#

let me turn them back on, and turn burst off

raw mica
#

I know we have some fixes for the Batch renderer coming in the next release of Unity as well

rotund token
#

i think they said it missed b10 on the forums

raw mica
#

Ah drats

rotund token
#

at least, 1 fix

#

i dont know how many are coming

#

oh wait no i read it wrong, missed b9 coming b10

#

but stack is different

rotund token
raw mica
#

Thanks for checking. When I'm back at my desk I can try those settings to see if I can repro

misty wedge
#

What do I need to do to make a client and server build on netcode? For some reason I can't get it to not exclude either

#

This worked before 1.0.0, even manually adding the defines doesn't work, I'm guessing something is modifying them

#

It either strips the initialization code for the client or server

#

I'm also missing the Server Build build option for some reason

#

This also just seems false:
When you build a standalone game, NetCode uses the Server Build property in the Build Settings window to decide what to build. If the property is enabled, NetCode sets the UNITY_SERVER define and you get a server-only build. If the property is disabled you get a combined client and server build. You can use a combined client and server build to decide if a game should be client, server or both at runtime.

#

I don't even have that property and it is stripping server code

rotund token
#

graphics guys are pretty good at reading stuff

#

Testing further and disabling ForceDebugAllocator stops it crashing

rotund token
raw mica
#

No that should be it. I'll reach out to the memory folks. I know they regressed tracking recently but I wouldn't have thought that went into 2022.2 but it's possible.

rotund token
#

I only have 2 bakers, 1 bakingsystem in this library

#

it shouldn't be hard for me to track down what i'm doing wrong but i'm only using 4 Temp allocations as far as i can tell

#

oh well, time for the classic disable 1 thing at a time

raw mica
#

Gah looks like it was indeed broken in 2022.2. But looks like it should be fixed in b11

rotund token
#

ah ok, good to know thanks

#

at least i've learnt how to handle this in the future

misty wedge
#

I really hope b10 or b11 fix my build issues, it's driving me mad

raw mica
#

@misty wedge does your Editor.log mention any other errors regarding globalgamemanagers.assets?

misty wedge
misty wedge
#

The build itself doesn't seem to really get "further" than this step

#

It will stay on Building Resources Folder for a long time and then throw the error 🀷

raw mica
#

Which platform is the player build for?

rotund token
#

(error DC0065: Only value type 'ISystem' types are allowed.
i'm so happy this was added, saving me from myself)

misty wedge
misty wedge
# raw mica <@855765518418182155> does your Editor.log mention any other errors regarding `g...

https://hastebin.com/vuretiwapa.makefile

There's a forum thread with the same issue on the same unity version here: https://forum.unity.com/threads/2022-02-0b9-asset-has-disappeared-while-building-player-to-globalgamemanagers-assets.1343288/
And a 4 month old reddit post that seems to have the exact same (or at least a very similar) issue: https://www.reddit.com/r/Unity3D/comments/uudiud/asset_has_dissapeared_while_building_player/

#

It's also weird because it says Error building Player: 2 errors but I don't see a second error. Unless it's referring to the default Build completed with a result of 'Failed' in 389 seconds (389478 ms) as that is also logged as an error...

rotund token
#

this is triggering me more than it should
Editor

#

Playmode

#

why does my hierarchy reorder itself

hollow notch
#

Hello, i have implemented several system that are not part of the game, and serve only as tools for debugging other systems, i wish to have them disabled until they are needed. What is the best workflow for this use-case?
Is it possible to list all system's and enable/disable with a checkbox in a custom editor window?

rotund token
#

you can enable/disable systems from within the System window

#

and simply in your OnCreate do something like Enable = false to start them disabled

#

then just enable them in your system window as required

#

you can always write more tooling on top for yourself if you want, remember state from last play instead of always setting disabled on start etc

viral sonnet
#

UNITY_EDITOR directives should help with this. use it for DisableAutoCreation attribute or Enabled state of a system

rotund token
#

i actually like my debug systems in development build

#

my draw debugging UI basically went from an editor window

#

into an in game toolbar so i could control it in development builds

viral sonnet
#

that's much cooler

#

oh right, i wanted to ask you about a screen you posted where you showed a list of subscenes. how did you do that?

rotund token
#

what screen?

viral sonnet
rotund token
#

oh just select them all in the hierarchy

#

the custom inspector draws them together like that

viral sonnet
#

ohh πŸ˜„

#

it will be a great day once we can go pure dots πŸ˜„

#

so many systems i can't rewrite yet to ISystem ... 😦

rotund token
#

orly? what's stopping you

viral sonnet
#

the obvious ones, animations and hybrid gameobjects πŸ˜„

#

the core systems were for the most part ISystem already just non-burst compiled OnCreate because of entityQuery or ECBS

rotund token
#

that's like, 2 systems for me

#

but yeah a lot of my oncreates aren't burst compiled

#

but that doesn't bother me too much

#

one time setup, usually behind a small load screen

#

500ms reduction in load screen isn't going to make/break game

#

though i will go through and enable what i can

hollow notch
# rotund token i actually like my debug systems in development build

Wow, that's an excellent idea for draw debug system's.

However, there are occasions when I wish to test a system in isolation or switch between two distinct gameplay systems.
Disabling system's that spawn entities in the system toolbar will not work since by the time I reach the window, all of the entities have already spawned.

viral sonnet
#

hm, i'm actually rethinking my hybrid entity spawn. i'm using standard ECBS for instantiating but i'm questioning the value of it now. i could instantiate a batch with the entityManager and that would probably be faster than the ECB that runs at the end in EndSimulation. they are both mainthread anyway, correct?

rotund token
hollow notch
hollow notch
# viral sonnet it will be a great day once we can go pure dots πŸ˜„

So far, I've avoided all of these issues by creating a 2D top-down game that doesn't require animations.
ECS is a great tool for making games heavily depend on system's like dwarf fortress or rimworld.
Characters in these games are tiny enough on screen that you can create the illusion of motion by just switching the skeletal pose on a 2d layered character.

misty wedge
patent kelp
#

Hi guys
How does one query entities that Have disabled Components? Basically, Entity.WithAll<myComponent>... disabled ... in the loop I can reenable all of the disabled entities... or is there a cooler way to do that? Entities 1.0 beta

balmy thistle
#

You add a tag component common to entities with your enablable component and query on that, either WithAll or WithNone for hte enablable component

patent kelp
#

Also, Is there a way in a Baker to add a disabled Component?

hollow notch
misty wedge
misty wedge
#

Like replacing hands or something?

viral sonnet
hollow notch
#

Yes, layered characters and sprite animations are incompatible.
Unless you employ sprite animation sparingly on individual body parts, you'll have to create animations for each each body part set, which is a nightmare for a small dev team.

misty wedge
#

But it is more complex than not doing it of course, and rimworld does just fine with only layered animations

#

Hell, dwarf fortress is just text

#

Although I doubt that ever helped it in gaining popularity...

brave field
rotund token
#

unfortunately at this stage it does not seem possible (enzi's investigation, i have not verified this myself)

haughty rampart
#

o-O there's a 'NetCoreRuntime' folder with .net 6.0.4 shipping with the current unity 2022.2
i know it was said it'll still take a while, but that's still a good sign

elfin spire
#

anyone familiar with the Mesh.MeshData api? I'm trying to remove faces that don't point in the proper direction but GetVertexData returns an array

haughty rampart
elfin spire
#

.ToList() doesn't seem to work

haughty rampart
#

not entirely sure why you would need a list in the first place for your use case

elfin spire
#

i need to remove faces which normals don't point towards a center

#

i'm merging a bunch of meshes and after that I need to remove their faces and do a bunch of stuff that change the size of the collection

haughty rampart
#

to remove the faces you need the GetIndexData()

elfin spire
#

yep, i have it

#

that's how the mesh is built

#

then?

viral sonnet
#

i hope this works out. my plan is now to provide a package to fix the hybrid question and entity <-> gameobject linking once and for all πŸ˜„

wraith hinge
haughty rampart
#

ah shucks

viral sonnet
#

lol, took me a few days now to realize this conversion circle. pretty useful

rotund token
#

you must have watched the gdc talk about this

#

was one of the highlights!

#

but yeah this is why i was trying to find the live baking option the other day (that defaulted off for me)

#

because it doesn't work without that on

viral sonnet
#

i have watched it aaaand forgot about it πŸ˜„

#

i've streamlined the hybrid process pretty good now and i support a few cases mostly covering the directions and spawn options for:

  • subscene entity spawns prefab go
  • scene go spawns entity prefab
zenith stirrup
#

trying to convert a GameObject prefab into an Entity prefab with a few components.

each GO prefab has a NetworkIdentityAuthoring + Baker.
however, the baker never seems to create the Entity in DOTS world.

  • is there any extra step needed to run the baker?
  • is there any way to bake not just into DefaultWorld, but into my custom worlds too?
viral sonnet
#

looks ok. do you have the go in a subscene?

zenith stirrup
#

in fact, are there any Entities 1.0 demos where we can see how this stuf works?

zenith stirrup
viral sonnet
#

well, how do you expect the entity to show up? there's no runtime conversion

#

put something like this in a subscene and reference your prefab: ```public class PrefabReference : MonoBehaviour
{
public GameObject prefab;

    public class PrefabReference_Baker : Baker<PrefabReference>
    {
        public override void Bake(PrefabReference authoring)
        {
            GetEntity(authoring.prefab);
        }
    }
}```
#

that makes sure that the entity will be created. you can use any kind of method to do this

zenith stirrup
#

thanks for help btw @viral sonnet , I have seen your name quite a few times now πŸ™‚

viral sonnet
#

np πŸ˜„ yes, that's the gist

rotund token
#

that enzi guy is alright

zenith stirrup
#

thanks, will try.
does anyone know if it's possible to target a specific (or all) worlds via baking?
seems to always bake to the standard world, with no 'world' setting being exposed anywhere

viral sonnet
#

no idea. wondered that myself when you asked that question. i've seen no way or mention of it.

rotund token
#

i don't really get the question

#

do you mean more, where a subscene loads into?

#

by default subscenes deserialize into World.DefaultGameObjectInjectionWorld

zenith stirrup
rotund token
#

oh actually no i lied

#

thats not true

#

Subscenes that are marked AutoLoad deserialize into all worlds that have SceneSystem during OnEnable

zenith stirrup
#

I have this on my PrefabSystem in GameObject world now.
Bake() is never called it seems. breakpoint doesn't hit either.
do I need to flag the GameObject in any way for Bake() to happen?

rotund token
#

but you can load a subscene into any world you want

#

(as long as you add the subscene systems)

#

SceneSystem.LoadSceneAsync(World, SubScene, Params)

viral sonnet
#

huh, so it doesn't really matter where it was baked. makes sense

#

interestingly the IBaker has a method for the NetCode package /// <summary> /// Checks if the the authoring component is baked in the Client World /// </summary> /// <returns>True if the NetCode package present and the authoring component is baked in the Client World</returns> public bool IsClient() { return (_State.World.Flags&WorldFlags.GameClient) == WorldFlags.GameClient; }

rotund token
#

yeah they added general client/server flags into root entities package

zenith stirrup
rotund token
#

i think they want to be able to bake specific data to client/server world in future

#

so servers dont need presentation and stuff and clients don't need server components etc

#

i'm not certain this is setup yet though

#

(but i haven't got around to testing netcode yet since the update)

viral sonnet
#

add it via git url: com.unity.netcode

rotund token
#

so yeah i expect the above stuff to change at some point

#

subscenes might end up holding multiple bakes

#

1 for client/server/other etc
something like this? who knows

zenith stirrup
rotund token
#

these packages don't appear in the package manager

#

you have to add them manually

#

add by name
com.unity.netcode

viral sonnet
#

guess it's best to look at what netcode does. seems there's already a way ... or not. anyway, the netcode package should answer how's the state of it πŸ™‚

dense storm
#

Anyone has an example on how to setup custom world?

#

Doing things in default world works, but I have no clue on how to get set of systems running in custom ones

viral sonnet
proud jackal
#

Just found an issue, and wanted to give you guys the headsup, that currently a line like this won't work:

public void OnDestroy(ref SystemState state) => SystemAPI.GetComponent<Singleton>(state.SystemHandle).Dispose();

As SystemAPI currently doesn't support being inside an Expression body syntax (the => arrow).. The worst bit, it will throw an SGICE instead of giving a proper error!..
Just wanted to give you guys the headsup, found it during a game jam this weekend πŸ˜†

To fix, type it like this instead:

public void OnDestroy(ref SystemState state)
{
    GetComponent<Singleton>(state.SystemHandle).Dispose();
}
rustic rain
# dense storm Anyone has an example on how to setup custom world?

Here's my custom world boot with systems being created only after certain crucial resources are loaded (and also after GO scene is loaded)

public class CustomWorldInit : ICustomBootstrap
    {
        private World _world;
        private BootExtensionManager _bootExtensionManager;

        public bool Initialize(string defaultWorldName)
        {
            SceneManager.sceneLoaded += SceneManagerOnSceneLoaded;

            Debug.Log("Creating world");

            _world = new World(defaultWorldName);
            World.DefaultGameObjectInjectionWorld = _world;

            _bootExtensionManager = new BootExtensionManager(_world);

            return true;
        }

        private async void SceneManagerOnSceneLoaded(Scene arg0, LoadSceneMode arg1)
        {
            Debug.Log("Creating systems");

            SceneManager.sceneLoaded -= SceneManagerOnSceneLoaded;

            var systems = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default);
            var bootSystems = systems.Where(x => typeof(IBootSystem).IsAssignableFrom(x)).ToList();
            var otherSystems = systems.Except(bootSystems).ToList();

            _bootExtensionManager.CreateBootExtensions();

            DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(_world, bootSystems);

            foreach (var system in _world.Systems)
            {
                if (system is IBootSystem bootSystem)
                {
                    await bootSystem.Ready();
                }
            }

            DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(_world, otherSystems);

            _bootExtensionManager.PostBootExtensionCall();

            #if !UNITY_DOTSRUNTIME
            ScriptBehaviourUpdateOrder.AppendWorldToCurrentPlayerLoop(_world);
            #endif
        }
    }
rotund token
#

Just wanted to give you guys the headsup, found it during a game jam this weekend
every 10 seconds?
(also thanks for heads up)

proud jackal
brave field
#

I guess state.EntityManager.CreateEntityQuery(ComponentType.ReadOnly<xxxComponent>()) still can't put [BurstCompile] attritbute at ISystem OnCreate then wat's the replacement API ?

rustic rain
#

but tbh, I don't see how it's crucial for OnCreate to be burst compiled

brave field
#

πŸ‘€ Just afraid old API will be deprecated soon.

rustic rain
#

a lot will be deprecated soon

#

I just wish Baking was one of them πŸ₯²

muted star
#

Hey guys, I modified com.unity.physics 0.51 32 to use soft floats for cross-platform determinism and in my testing box colliders are acting a bit strange.
It seems like the front collider vertices work fine but the vertices at the back tend to droop into the floor.
Is this normal? I'm running the physics simulation every 66ms.
Any ideas what could be causing this problem or how to improve the situation?

#

Because I'm no longer using normal floats I can't use authoring components for now, so I'm setting up the colliders manually.
Code for the ground:
||```
EntityManager.AddComponentData(
ground,
new PhysicsCollider
{
Value = BoxCollider.Create(
new BoxGeometry
{
Center = float3.zero,
Size = new float3((sfloat)100f, (sfloat)10f, (sfloat)100f),
Orientation = new quaternion(float4x4.identity),
}
)
}
);
EntityManager.AddSharedComponentData(ground, new PhysicsWorldIndex {Value = 0});
EntityManager.AddComponent<PhysicsVelocity>(ground);
EntityManager.AddComponentData(
ground,
PhysicsMass.CreateKinematic(MassProperties.UnitSphere)
);
EntityManager.AddComponentData(
ground,
new PhysicsDamping
{
Linear = (sfloat) 0.01f,
Angular = (sfloat) 0.05f
}
);
EntityManager.AddComponentData(ground, new PhysicsGravityFactor {Value = (sfloat) 1f});

#

Code for the dynamic box colliders:
||```
EntityManager.AddComponentData(
unit,
new PhysicsCollider
{
Value = BoxCollider.Create(
new BoxGeometry
{
BevelRadius = sfloat.Zero,
Center = new float3((sfloat)0f, (sfloat)0.45f, (sfloat)(-0.27f)),
Size = new float3((sfloat)5.6f, (sfloat)1.2f, (sfloat)8f),
Orientation = new quaternion(float4x4.identity),
}
)
}
);
EntityManager.AddSharedComponentData(unit, new PhysicsWorldIndex {Value = 0});
EntityManager.AddComponent<PhysicsVelocity>(unit);
EntityManager.AddComponentData(
unit,
PhysicsMass.CreateDynamic(MassProperties.UnitSphere, (sfloat) 1000.0f)
);
EntityManager.AddComponentData(
unit,
new PhysicsDamping
{
Linear = (sfloat) 0.01f,
Angular = (sfloat) 0.05f
}
);
EntityManager.AddComponentData(unit, new PhysicsGravityFactor {Value = (sfloat) 1f});

#

PhysicsStep configuration:
||```
var entity = EntityManager.CreateEntity();
EntityManager.AddComponentData(entity, new PhysicsStep
{
SimulationType = SimulationType.UnityPhysics,
Gravity = new float3(sfloat.Zero, sfloat.FromRaw(0xc11cf5c3), sfloat.Zero),
SolverIterationCount = 4,
SolverStabilizationHeuristicSettings = Solver.StabilizationHeuristicSettings.Default,
MultiThreaded = 1,
SynchronizeCollisionWorld = 0
});

rotund token
#

does not look normal

devout prairie
# muted star

you try maybe upping iterations in case it's just missing the collisions?

#

( at least just to confirm/diagnose )

#

i noticed the mass is 1000 i have noticed that mass seems to have an impact on how well collisions are performed..

#

for example i had a catapult setup, which i was testing out launching a simple sphere - when the mass of the sphere was high, the throwing-arm of the catapult would just pass straight through it

#

was just looking at CreateDynamic not sure if that accepts an inverse mass value or just straight mass number, maybe worth double checking

dense crypt
#

Is there a utility somewhere to convert IComponentData to NativeArray<byte>?

rotund token
#

you mean like a byte reinterpretation of it?

#

var ptr = &component;
UnsafeNativeArrayUtility.ConvertExistingDataToArray<byte>(ptr, Allocator.None)

#

(names are wrong but you should find it)

dense crypt
#

Yeah exactly, I went through UnsafeUtility.. good to know there's also a NativeArrayUnsafeUtility πŸ˜…

dense crypt
#

Hmm, since my component is a field in a ScriptableObject it seems that method doesn't work. I thought I could just GC-Pin the object and use it, but the returned array is always effectively null

rustic rain
dense crypt
rustic rain
#

oh, it's boxed

#

I guess what you could do

#

is get type of it

#

convert to ComponentType

#

through TypeManager

#

get size

#

and do MemCpy to NativeArray<byte>

proud jackal
dense crypt
# proud jackal Why do you store it like that, may I ask? πŸ‘€

Working on a setup that allows us to store configuration data in a ScriptableObject, if the stored data is a IComponenData I mark it with an attribute. Then whenever that data changes it should be forwarded to the ECS world and overwrite any existing components with the new data. Think OnValidate but in a generic way for ECS data. This is specifically only for the editor

dense crypt
tropic venture
muted star
muted star
devout prairie
#

there didn't look to be anything fundamentally wrong that i could see

muted star
devout prairie
#

hmmm

#

yeh i mean realistically i think max 6 iterations, i think i'm currently using 2 πŸ˜›

#

but yeah just to diagnose if that's actually the issue

#

fwiw maybe test with a plane for ground instead of cube?

#

yeah maybe test it with a plane for the ground

muted star
#

when I make the collider for the ground very thin, the dynamic colliders fall through the ground.

devout prairie
#

mm i think there's a plane, haha maybe i should double check that

#

there is a Plane in physics shape authoring

#

my ground was previously a box tbh and it was ok

#

i think what i've observed with physics is when it propagates multiple collisions it does seem to struggle at times

#

i've had to do a lot of work to work around issues like that

#

in your clip, the second object goes through the first when it lands on it, so really that shouldn't be happening

#

only other thing i can think is enable contact stablization, tbh that might fix it:

#

the default in your code will be false i think

muted star
muted star
devout prairie
#

other option might be increase the collider radius, i couldn't quite fathom the description of this in the docs but in theory i think it should push out the faces by a margin.. thing is when you see the debug colliders after doing this it appears to actually shrink the size of the colliders :S

muted star
muted star
devout prairie
devout prairie
muted star
muted star
devout prairie
muted star
#

I noticed that the author of the outdated deterministic soft float physics likes to use arrow getters, even when the returned value should always be the same.
Why would you write

public static MassProperties UnitSphere => new MassProperties
        ...
``` instead of

public static readonly MassProperties UnitSphere = new MassProperties
...

muted star
devout prairie
viral sonnet
#

those physics problem look like a hard case. maybe it's best to setup the same scene with normal physics and then go from there. you can yhen debug the vales per frame. output them to a log. find the differences, etc...

#

physics has weird behaviour on its own so first get something stable

wraith hinge
#

I noticed that the author of the

rustic rain
#
        [BurstCompile]
        public void OnDestroy(ref SystemState state)
        {
        }
```πŸ€”
#

is that a good thing?

#

feels like it makes Burst call invocation for nothing. Also making library size larger

wraith hinge
#

i don't know if burst call overhead is worse than normal call overhead tbh. it might be? probably depends

#

that said, i'm not sure i've seen ondestroy show up in profiles ever either way

muted star
rustic rain
#

oof

#
        // The ChunkEntityEnumerator helps us loop over
        // the entities of the chunk, but only those that
        // match the query (accounting for disabled components).
        var enumerator = new ChunkEntityEnumerator(
                useEnableMask,
                chunkEnabledMask,
                chunk.ChunkEntityCount);
#

Wouldn't that break vectorization?

wraith hinge
#

not necessarily; sometimes llvm can do the mask lanes thing like a shader. gotta look at the asm if you're worried

#

(in general, if i ever find myself stressed about whether something is going to be vectorized, i'm probably just going to go straight for intrinsics rather than trying to trick llvm into doing it. maybe i've just been poisoned by https://pharr.org/matt/blog/2018/04/30/ispc-all , not sure. llvm vectorizing is great, but if it's mission-critical i'm probably going to take the wheel)