CheaterCodes
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Falling Block - "Easy Method" This Document provides an overview over the proposed "easy method". The proposed setup is intended to be fully afkable, so that we can hit the first race condition even with low chances. ## Naming convention **Base Chunks (B):** A certain number of chunks is expected to be always loaded. This includes spawn chunks, as well as player loaded chunks. In order to ensure the rest of the process is as reliable as possible, this number of chunks has to be fixed. **Cluster Chunks (C\):** This is a set of chunks where as many chunks positions as possible have the same or consecutive hashes. The number of actually consecutive chunks is the variable most likely modified for retiming. **Glass Chunks (G):** These are the chunks that are meant to be reloaded off-thread. They are named like this because adding/removing glass blocks is what starts the threads in these chunks. **Rehash Chunk (R\):** This chunk triggers the rehashing. Ideally, this is only a single chunk. ## Process First, a general overview: 1. **Autosave:** Unloads all but the base chunks 2. **Load cluster:** Load the cluster chunks 3. **Load glass:** Load the glass chunks 4. **Start Threads:** Push glass blocks in glass chunks 5. **Rehash:** Load the rehash chunk 6. **Reset:** Reset all redstone ### Autosave Since this is intended to be fully automatic, auto saving is the only way to unload chunks. After this, the only loaded chunks are the base chunks. The number of base chunks has to be chosen such that the hash-map resizes to it's lower size, i.e. between 10% and 18% of it's full size. ### Load Cluster & Load Glass After the autosave, the cluster and glass chunks are loaded. The cluster chunks can be loaded in arbitrary order, but the glass chunks should be loaded after as many cluster chunks as possible. The number of base + cluster + glass chunks should be one short of causing a rehash. ### Start Threads Now that all but one chunk are loaded, the glass threads are started. Inside the glass chunks, pistons start pushing stained glass blocks. We likely want as many glass blocks as possible, as high up in the world as possible. ### Rehash Immediately after all glass pistons start moving, the rehash chunk is loaded, causing a rehash of the underlying hash-map. If the entire process was successful, at least one of the beacon threads will reload their own chunk and an observer chain can relay asynchronous block-updates indefinitely. Note that this observer-chain is unload protected. This means that the rest of the system keep running without ruining the success. ### Reset After an (unsuccessful) attempt, all the restone in the system resets. Glass blocks must be pushed back in their original positions and redstone must be depowered. ## Chunk Layout ### Base Chunks These can be any chunks that are ensured to stay loaded during the described process. Most likely, these are simple the spawn-chunks plus the player loaded chunks. I'd recommend to chunk load the area around the player so that they don't acidentally load any more chunks. ### Cluster Chunks This should be a local groups of chunks, where as many of these chunks as possible share the lower bits of the hashed chunk position, or are at least consecutive. Note that the locality isn't strictly necessary, but likely makes the loading process easier. ### Glass Chunks This should be unpopulated chunks with the same hash as the cluster chunk, or at least consecutive. The goal here is to make the hashmap lookup of the glass chunks as slow as possible. This can be achieved by inserting other chunks with the same hash before them. Note that the only requirement for these chunks is that they are unpopulated. Therefore, it makes sense to simply search for a convenient cluster and then pick the glass chunks from that. Inside of these chunks will be a contraption that moves a lot of stained glass blocks as well as an observer chain detecting the generation of water fountains. Note that these chunks will have to be protected against population. ### Rehash Chunk This can be any chunk easily loadable via a signal. ### Numbers Which exact numbers of chunks has to be loaded is uncertain, but here are some possible scenarios and some arguments for choosing our final layout. | Base Size | Mask | Base Chunks | Cluster Chunks | |---------- | ------ | ------------- | -------------- | | 2048 | 11 bit | 27x27 | 26x31 | | 4096 | 12 bit | 27x27 + 27x27 | 26x62 + 1 | #### Base Size The total size of the hashmap. At 75% fullness the map rehashes, resizing upwards. Below ~20% the map rehashes, resizing downwards. This has to be a power of two, limiting our options a lot. We probably don't want to go too big since we'll quickly have to load an unreasonable amount of chunks. 8k or maybe 16k should be the limit. Lower than 1024 is impossible due to spawn chunks, with a player online lower than 2048 is impossible. #### Mask The bigger the base size, the bigger the mask. A bigger mask means a bigger distance between valid cluster chunks. However, a bigger mask also allows to load more chunks. #### Base chunks Needs to be als least 10% of the base size to prevent downsizing twice. > Is that even true? Can be at most ~18% (3/16) of the base size to ensure autosave resizes down. #### Cluster Chunks ## Uncertain things - Make sure Long2ObjectopenHashMap.get() doesn't crash if the mask changes - It's fine cause the n+1-th entry in the keys is always 0 - Make sure Long2ObjectopenHashMap.get() returns null after resize - If get() wraps around, it's fine - If it doesn't, we need to make sure to not have an entry in the new value array at the old key position - All the timings

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully