feat(v4): Phase 7 Task 4 -- v3's entropy, TOP-WORDS, WORD-ENTROPY and (- words (#189)
capsules/v4/physics.4th, blocks 8202-8204: ENTROPY@ ENTROPY! RESET-ENTROPY as kernel requests -35..-37 (a word's heat by the address ' leaves, a data word's too; an error for what is not a word, as v3's); TOP-WORDS and WORD-ENTROPY in StarForth, printing in v3's form what the kernel gives them through (HOT#) (HOT) (XT-HEAT), -38..-40 (the i-th hottest in v3's stable order); (- in StarForth, skipping to the matching close paren with nesting, as v3's code does. Tests first: test_mesh_boot.c 101 checks, 110 on, 98 without opcode physics. Listing: 403 live words. amd64 PASS, word_count=403. Not pushed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
@@ -69,6 +69,13 @@
|
||||
#define V4_REQ_INFER_VARIANCE (-32) /* ( -- q ) */
|
||||
#define V4_REQ_INFER_FIT (-33) /* ( -- q ) */
|
||||
#define V4_REQ_INFER_EARLY (-34) /* ( -- flag ) */
|
||||
/* v3's StarForth module: a word's execution heat by the address ' leaves, and the hottest */
|
||||
#define V4_REQ_ENTROPY_FETCH (-35) /* ( addr -- n ): an error if addr is not a word's */
|
||||
#define V4_REQ_ENTROPY_STORE (-36) /* ( n addr -- ) */
|
||||
#define V4_REQ_RESET_ENTROPY (-37) /* ( -- ): every word's heat and temperature to 0 */
|
||||
#define V4_REQ_HOT_COUNT (-38) /* ( -- n ): words with heat */
|
||||
#define V4_REQ_HOT_NTH (-39) /* ( i -- xt heat ): the i-th hottest, as v3's TOP-WORDS orders them; 0 0 past them */
|
||||
#define V4_REQ_XT_HEAT (-40) /* ( xt -- n ): a word's heat, 0 for what is not one */
|
||||
typedef struct {
|
||||
v4_uheat_t calls; /* every call since the word was defined */
|
||||
v4_uheat_t since; /* calls since the owner last charged them */
|
||||
|
||||
Reference in New Issue
Block a user