# getVisibleInstanceIds
Source: https://docs.maelstrom-ai.co/dev/reference/protocol/functions/getvisibleinstanceids/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **getVisibleInstanceIds**(`layout`): `ReadonlySet`<[`InstanceId`](https://docs.maelstrom-ai.co/dev/reference/protocol/type-aliases/instanceid/)\>

Defined in: [packages/protocol/src/lib/response.ts:497](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/protocol/src/lib/response.ts#L497)

Projects the Instance references eligible for rendering from a layout.

This projection has no retained Instance store to resolve against. Callers that need the Instances actually rendered must intersect the result with their retained IDs.

Grid visibility is every position. For tiling layouts, tokens are consumed for the first preorder root: a split token requires as many children as its weights declare, `null` fills a child slot without adding an Instance, and input may end with child slots still missing. Encountered Instance leaves remain visible in a partial or otherwise malformed root. Duplicate leaves are returned once in first encounter order, while tokens trailing the parsed root are ignored.

Tiling projection is iterative and stack-safe for deeply nested input. This guarantee applies only to visibility projection, not to downstream parsers or renderers. A null layout has no visible Instances.

## Parameters

### layout

[`GridLayout`](https://docs.maelstrom-ai.co/dev/reference/protocol/interfaces/gridlayout/) | [`TilingLayout`](https://docs.maelstrom-ai.co/dev/reference/protocol/interfaces/tilinglayout/) | `null`

## Returns

`ReadonlySet`<[`InstanceId`](https://docs.maelstrom-ai.co/dev/reference/protocol/type-aliases/instanceid/)\>
